Re: [PATCH 2/2] qemu: Migrate memory on numatune change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 03/20/2015 04:53 AM, Martin Kletzander wrote:
> On Thu, Mar 19, 2015 at 07:30:26PM -0400, John Ferlan wrote:
>>
>>

<...snip...>

>>> @@ -792,9 +795,12 @@ static void
>>>  qemuRestoreCgroupState(virDomainObjPtr vm)
>>>  {
>>>      char *mem_mask = NULL;
>>> +    char *nodeset = NULL;
>>>      int empty = -1;
>>>      qemuDomainObjPrivatePtr priv = vm->privateData;
>>> +    size_t i = 0;
>>>      virBitmapPtr all_nodes;
>>> +    virCgroupPtr cgroup_temp = NULL;
>>>
>>>      if (!(all_nodes = virNumaGetHostNodeset()))
>>>          goto error;
>>> @@ -809,9 +815,37 @@ qemuRestoreCgroupState(virDomainObjPtr vm)
>>
>> So this is the path for currently running guests to be adjusted on
>> livirtd restart after install, right?
>>
>>>      if (virCgroupSetCpusetMems(priv->cgroup, mem_mask) < 0)
>>>          goto error;
>>>
>>> +    for (i = 0; i < priv->nvcpupids; i++) {
>>> +        if (virCgroupNewVcpu(priv->cgroup, i, false, &cgroup_temp) <
>>> 0 ||
>>> +            virCgroupSetCpusetMemoryMigrate(cgroup_temp, true) < 0 ||
>>> +            virCgroupGetCpusetMems(cgroup_temp, &nodeset) < 0 ||
>>> +            virCgroupSetCpusetMems(cgroup_temp, nodeset) < 0)
>>> +            goto cleanup;
>>> +
>>> +        virCgroupFree(&cgroup_temp);
>>> +    }
>>> +
>>> +    for (i = 0; i < priv->niothreadpids; i++) {
>>> +        if (virCgroupNewIOThread(priv->cgroup, i, false,
>>> &cgroup_temp) < 0 ||
>>
>> cgroup iothread id's are 1..n, so I believe this should be 'i + 1'
>>
> 
> Yes, once again I felt for the contraption in this.  That shall not
> happen henceforth!
> 

I usually use cscope in order to find all callers to help remind me
since I know my memory isn't as good as it once was...

I assume you've made the change and so that it's official this is your
ACK...

John
>> simple enough to test by adding <iothreads>2</iothreads> to your domain
>> definition and making sure this works...
>>
> 
> I remember trying with <iothreads>1</iothreads>, there must have been
> no allocation as I only checked that the memory moved -- my bad.
> 
>> Beyond that - seems reasonable to me
>>
>> John

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]