[PATCH] qemu: don't setup cpuset.mems if memory mode in numatune is 'preferred'

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

 



If the memory mode is specified as preferred, we get the following error when
starting domain.

error: Unable to write to '$my_cgroup_path/cpuset.mems': Device or resource busy

XML is configured with numatune as follows:
  <numatune>
    <memory mode='preferred' nodeset='0'/>
  </numatune>

If memory mode is 'preferred', cpuset.mems in cgroup shouldn't be set to
'nodeset'. I find that maybe commit 1a7be8c600905aa07ac2d78293336ba8523ad48e
changes the former logic of checking mode in virDomainNumatuneGetNodeset.

Signed-off-by: Wang Rui <moon.wangrui@xxxxxxxxxx>
---
 src/qemu/qemu_cgroup.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index b5bdb36..8685d6f 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -618,6 +618,11 @@ qemuSetupCpusetMems(virDomainObjPtr vm,
     if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET))
         return 0;
 
+    if (virDomainNumatuneGetMode(vm->def->numatune, -1) !=
+        VIR_DOMAIN_NUMATUNE_MEM_STRICT) {
+        return 0;
+    }
+
     if (virDomainNumatuneMaybeFormatNodeset(vm->def->numatune,
                                             nodemask,
                                             &mem_mask, -1) < 0)
-- 
1.7.12.4

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