]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Keep the affinity when creating cgroup for emulator thread
authorOsier Yang <jyang@redhat.com>
Wed, 24 Oct 2012 09:27:56 +0000 (17:27 +0800)
committerOsier Yang <jyang@redhat.com>
Wed, 24 Oct 2012 13:46:24 +0000 (21:46 +0800)
commitbb81021bfe97ac8e6fe22a4d435993db7044047a
tree8e798a1b19ab015fee8a6df0d992e6fda241eb21
parent0039a32fcaf7f748cad22376681f505fcfa78cef
qemu: Keep the affinity when creating cgroup for emulator thread

When the cpu placement model is "auto", it sets the affinity for
domain process with the advisory nodeset from numad, however,
creating cgroup for the domain process (called emulator thread
in some contexts) later overrides that with pinning it to all
available pCPUs.

How to reproduce:

  * Configure the domain with "auto" placement for <vcpu>, e.g.
    <vcpu placement='auto'>4</vcpu>
  * % virsh start dom
  * % cat /proc/$dompid/status

Though the emulator cgroup cause conflicts, but we can't simply
prohibit creating it, as other tunables are still useful, such
as "emulator_period", which is used by API
virDomainSetSchedulerParameter. So this patch doesn't prohibit
creating the emulator cgroup, but inherit the nodeset from numad,
and reset the affinity for domain process.

* src/qemu/qemu_cgroup.h: Modify definition of qemuSetupCgroupForEmulator
                          to accept the passed nodenet
* src/qemu/qemu_cgroup.c: Set the affinity with the passed nodeset
src/qemu/qemu_cgroup.c
src/qemu/qemu_cgroup.h
src/qemu/qemu_process.c