Re: [libvirt] [PATCH] Fix initial VCPU pinning in qemu driver

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

 



On Wed, Apr 21, 2010 at 09:56:09AM +0200, Jiri Denemark wrote:
> First, inital VCPU pinning is set correctly but then it is reset by
> assigning qemu process to a new cgroup (which contains all CPUs). It's
> easily fixed by swapping these two actions.
> ---
>  src/qemu/qemu_driver.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> Originally, I thought it would be better to change the initial pinning
> at cgroup level but then I realized it was not a good idea. AFAIK cgroup
> olny works for processes and is not usable for per-VCPU pinning. That
> is, it is fine to have all CPUs in cgroup and fine tune VCPU pinning by
> setting procss affinity.
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 5f4adfd..cc3e3b2 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -3081,10 +3081,10 @@ static int qemudSecurityHook(void *data) {
>      /* This must take place before exec(), so that all QEMU
>       * memory allocation is on the correct NUMA node
>       */
> -    if (qemudInitCpuAffinity(h->vm) < 0)
> +    if (qemuAddToCgroup(h->driver, h->vm->def) < 0)
>          return -1;
>  
> -    if (qemuAddToCgroup(h->driver, h->vm->def) < 0)
> +    if (qemudInitCpuAffinity(h->vm) < 0)
>          return -1;
>  
>      if (h->driver->securityDriver &&

ACK, but can you add a comment in the code too, that the cpuaffinity 
setup must come after the cgroup placement.

Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

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