[libvirt] [PATCH 3/3] qemu: Return true pining info when using numad

Martin Kletzander mkletzan at redhat.com
Fri Aug 7 10:44:19 UTC 2015


On Tue, Aug 04, 2015 at 09:27:13PM -0400, John Ferlan wrote:
>$SUBJ
>
>s/pining/pinning
>
>Or perhaps - "qemu: Use numad information when getting pin information""
>

OK, I won't mention anything pine-cone-related then ;)

>On 07/26/2015 12:57 PM, Martin Kletzander wrote:
>> Pinning information returned for emulatorpin and vcpupin calls is being
>> returned from our data without querying cgroups for some time.  However,
>> not all the data were utilized.  When automatic placement is used the
>> information is not returned for the calls mentioned above.  Since the
>> numad hint in private data is properly saved/restored, we can safely use
>> it to return true information.
>>
>> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1162947
>>
>> Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
>> ---
>>  src/qemu/qemu_driver.c | 11 +++++++++++
>>  1 file changed, 11 insertions(+)
>>
>
>Should qemuDomainGetIOThreadsConfig be adjusted as well?  In the for
>loop that's fetching/filling in the iothreadid there's a filling of the
>cpumask as well.
>

From the name I think that rather qemuDomainGetIOThreadsLive() should
be adjusted, not Config(), unless I misunderstood what they do.

>Patches seem reasonable otherwise, although patch2 could have a wee bit
>more information in the commit log to explain what's being done...

OK, I'll add some info in there.

>Beyond that does that value matter if placement_mode !=
>VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO? or if
>!virDomainDefNeedsPlacementAdvice (from qemuProcessStart)?  Was checking
>where it was set and if it's set to something reasonable...
>

No it doesn't.  Is there a problem with that?  I haven't found any.

>John
>
>> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>> index 40c882c4ba88..1e090bb5c36b 100644
>> --- a/src/qemu/qemu_driver.c
>> +++ b/src/qemu/qemu_driver.c
>> @@ -5224,6 +5224,7 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom,
>>      int ret = -1;
>>      int hostcpus, vcpu;
>>      virBitmapPtr allcpumap = NULL;
>> +    qemuDomainObjPrivatePtr priv = NULL;
>>
>>      virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
>>                    VIR_DOMAIN_AFFECT_CONFIG, -1);
>> @@ -5244,6 +5245,7 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom,
>>          goto cleanup;
>>
>>      virBitmapSetAll(allcpumap);
>> +    priv = vm->privateData;
>>
>>      /* Clamp to actual number of vcpus */
>>      if (ncpumaps > def->vcpus)
>> @@ -5262,6 +5264,9 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom,
>>
>>          if (pininfo && pininfo->cpumask)
>>              bitmap = pininfo->cpumask;
>> +        else if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO &&
>> +                 priv->autoCpuset)
>> +            bitmap = priv->autoCpuset;
>>          else
>>              bitmap = allcpumap;
>>
>> @@ -5412,6 +5417,7 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
>>      int hostcpus;
>>      virBitmapPtr cpumask = NULL;
>>      virBitmapPtr bitmap = NULL;
>> +    qemuDomainObjPrivatePtr priv = NULL;
>>
>>      virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
>>                    VIR_DOMAIN_AFFECT_CONFIG, -1);
>> @@ -5428,10 +5434,15 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
>>      if ((hostcpus = nodeGetCPUCount(NULL)) < 0)
>>          goto cleanup;
>>
>> +    priv = vm->privateData;
>> +
>>      if (def->cputune.emulatorpin) {
>>          cpumask = def->cputune.emulatorpin;
>>      } else if (def->cpumask) {
>>          cpumask = def->cpumask;
>> +    } else if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO &&
>> +               priv->autoCpuset) {
>> +        cpumask = priv->autoCpuset;
>>      } else {
>>          if (!(bitmap = virBitmapNew(hostcpus)))
>>              goto cleanup;
>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150807/c266d7e8/attachment-0001.sig>


More information about the libvir-list mailing list