Re: [PATCH v3 10/13] qemu: vcpu: Aggregate code to set vCPU tuning

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

 



On Fri, Feb 05, 2016 at 04:44:46PM +0100, Peter Krempa wrote:
> Rather than iterating 3 times for various settings this function
> aggregates all the code into single place. One of the other advantages
> is that it can then be reused for properly setting vCPU info on hotplug.
> 
> With this approach autoCpuset is also used when setting the process
> affinity rather than just via cgroups.
> ---
> 
> Notes:
>     v3:
>     - mention change to affinity in commit message
>     - reorder affinity/cgroups
>     - fix comment spacing
> 
>  src/qemu/qemu_cgroup.c  |  95 ---------------------
>  src/qemu/qemu_cgroup.h  |   1 -
>  src/qemu/qemu_process.c | 215 +++++++++++++++++++++++++++++++++---------------
>  src/qemu/qemu_process.h |   4 +
>  4 files changed, 151 insertions(+), 164 deletions(-)


> +
> +    if (cpumask) {
> +        /* setup cgroups */
> +        if (cgroup_vcpu &&
> +            virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) {
> +            if (mem_mask &&
> +                virCgroupSetCpusetMems(cgroup_vcpu, mem_mask) < 0)
> +                goto cleanup;
> +
> +            if (qemuSetupCgroupCpusetCpus(cgroup_vcpu, cpumask) < 0)
> +                goto cleanup;
> +        }
> +

> +        /* setup legacy affinty */
> +        if (virProcessSetAffinity(vcpupid, cpumask) < 0)
> +            goto cleanup;

This hunk...

> +    }
> +
> +    /* move the thread for vcpu to sub dir */
> +    if (cgroup_vcpu &&
> +        virCgroupAddTask(cgroup_vcpu, vcpupid) < 0)
> +        goto cleanup;
> +

should go here after the thread has been moved to its cgroup dir to
preserve the original order.

Jan

Attachment: signature.asc
Description: Digital signature

--
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]