[PATCH 2/3] qemu: do not put a task into machine cgroup

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

 



The machine cgroup is a superset, a parent to the emulator and vcpuX
cgroups. The parent cgroup should never have any tasks directly in it.
In fact the parent cpuset might contain way more cpus than the sum of
emulatorpin and vcpupins. So putting tasks in the superset will allow
them to run outside of <cputune>.

Signed-off-by: Henning Schild <henning.schild@xxxxxxxxxxx>
---
 src/qemu/qemu_cgroup.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index 28d2ca2..2c74a22 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -769,12 +769,6 @@ qemuInitCgroup(virQEMUDriverPtr driver,
         goto cleanup;
     }
 
-    if (virCgroupAddTask(priv->cgroup, vm->pid) < 0) {
-        virCgroupRemove(priv->cgroup);
-        virCgroupFree(&priv->cgroup);
-        goto cleanup;
-    }
-
  done:
     ret = 0;
  cleanup:
@@ -1145,6 +1139,10 @@ qemuSetupCgroupForEmulator(virDomainObjPtr vm)
             goto cleanup;
     }
 
+    /* consider the first thread an emulator-thread */
+    if (virCgroupAddTask(cgroup_emulator, vm->pid) < 0)
+        goto cleanup;
+
     virCgroupFree(&cgroup_emulator);
     return 0;
 
-- 
2.4.10

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