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

Martin Kletzander mkletzan at redhat.com
Tue Nov 4 14:04:37 UTC 2014


On Tue, Nov 04, 2014 at 09:22:22PM +0800, Wang Rui wrote:
>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 at huawei.com>
>---
> src/qemu/qemu_cgroup.c | 5 +++++
> 1 file changed, 5 insertions(+)
>

Thanks for catching that, it definitely is a problem, but I think it
is cause by commit 93e82727ec11d471d2ef3a18835e1fdfe062cef1.

It should be also fixed in virLXCCgroupSetupCpusetTune() for LXC.

>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;
>+    }
>+

One question, is it problem only for 'preferred' or 'interleaved' as
well?  Because if it's only problem for 'preferred', then the check is
wrong.  If it's problem for 'interleaved' as well, then the commit
message is wrong.

Anyway, after either one is fixed, I can push this.

Thank you,
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141104/f3d28324/attachment-0001.sig>


More information about the libvir-list mailing list