提交 38a0f6df 编写于 作者: W Wang Rui 提交者: Martin Kletzander

qemu: don't setup cpuset.mems if memory mode in numatune is not 'strict'

If the memory mode in numatune is specified as 'preferred' with one node
(such as nodeset='0'), domain's memory is not all in node 0 absolutely.
Assumption that node 0 doesn't have enough memory, memory can be allocated
on node 1 when qemu process startup. Then if we set cpuset.mems to '0',
it may invoke OOM.

Commit 1a7be8c6 changed the former logic of
checking memory mode in virDomainNumatuneGetNodeset. This patch adds the
check as before.
Signed-off-by: NWang Rui <moon.wangrui@huawei.com>
上级 12bd207e
...@@ -618,6 +618,10 @@ qemuSetupCpusetMems(virDomainObjPtr vm, ...@@ -618,6 +618,10 @@ qemuSetupCpusetMems(virDomainObjPtr vm,
if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET))
return 0; return 0;
if (virDomainNumatuneGetMode(vm->def->numatune, -1) !=
VIR_DOMAIN_NUMATUNE_MEM_STRICT)
return 0;
if (virDomainNumatuneMaybeFormatNodeset(vm->def->numatune, if (virDomainNumatuneMaybeFormatNodeset(vm->def->numatune,
nodemask, nodemask,
&mem_mask, -1) < 0) &mem_mask, -1) < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册