|
|
c480ed |
From 77eb53c13d2d9a641143cc374f8262c2cb004120 Mon Sep 17 00:00:00 2001
|
|
|
c480ed |
Message-Id: <77eb53c13d2d9a641143cc374f8262c2cb004120@dist-git>
|
|
|
c480ed |
From: Pavel Hrdina <phrdina@redhat.com>
|
|
|
c480ed |
Date: Mon, 1 Jul 2019 17:08:14 +0200
|
|
|
c480ed |
Subject: [PATCH] util: enable cgroups v2 cpuset controller for threads
|
|
|
c480ed |
MIME-Version: 1.0
|
|
|
c480ed |
Content-Type: text/plain; charset=UTF-8
|
|
|
c480ed |
Content-Transfer-Encoding: 8bit
|
|
|
c480ed |
|
|
|
c480ed |
When we create cgroup for qemu threads we need to enable cpuset
|
|
|
c480ed |
controller in order to use it.
|
|
|
c480ed |
|
|
|
c480ed |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
c480ed |
(cherry picked from commit a6aedcf39bd3212a3cd624b765bb724fd36d6a8a)
|
|
|
c480ed |
|
|
|
c480ed |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1689297
|
|
|
c480ed |
|
|
|
c480ed |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
c480ed |
Message-Id: <1dfb136ea7a417fdcc03b84c59bb364a75e24d52.1561993100.git.phrdina@redhat.com>
|
|
|
c480ed |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
c480ed |
---
|
|
|
c480ed |
src/util/vircgroupv2.c | 6 ++++++
|
|
|
c480ed |
1 file changed, 6 insertions(+)
|
|
|
c480ed |
|
|
|
c480ed |
diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c
|
|
|
c480ed |
index ef1f286726..04638c4e50 100644
|
|
|
c480ed |
--- a/src/util/vircgroupv2.c
|
|
|
c480ed |
+++ b/src/util/vircgroupv2.c
|
|
|
c480ed |
@@ -401,6 +401,12 @@ virCgroupV2MakeGroup(virCgroupPtr parent ATTRIBUTE_UNUSED,
|
|
|
c480ed |
VIR_CGROUP_CONTROLLER_CPU) < 0) {
|
|
|
c480ed |
return -1;
|
|
|
c480ed |
}
|
|
|
c480ed |
+
|
|
|
c480ed |
+ if (virCgroupV2HasController(parent, VIR_CGROUP_CONTROLLER_CPUSET) &&
|
|
|
c480ed |
+ virCgroupV2EnableController(parent,
|
|
|
c480ed |
+ VIR_CGROUP_CONTROLLER_CPUSET) < 0) {
|
|
|
c480ed |
+ return -1;
|
|
|
c480ed |
+ }
|
|
|
c480ed |
} else {
|
|
|
c480ed |
size_t i;
|
|
|
c480ed |
for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
|
|
|
c480ed |
--
|
|
|
c480ed |
2.22.0
|
|
|
c480ed |
|