提交 e04d1074 编写于 作者: P Peter Krempa

qemu: process: Don't put memoryless NUMA nodes into autoNodeset

'numad' may return a nodeset which contains NUMA nodes without memory
for certain configurations. Since cgroups code will not be happy using
nodes without memory we need to store only numa nodes with memory in
autoNodeset.

On the other hand autoCpuset should contain cpus also for nodes which
do not have any memory.
上级 9f3e65fc
...@@ -5174,6 +5174,8 @@ qemuProcessPrepareDomainNUMAPlacement(virDomainObjPtr vm, ...@@ -5174,6 +5174,8 @@ qemuProcessPrepareDomainNUMAPlacement(virDomainObjPtr vm,
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
char *nodeset = NULL; char *nodeset = NULL;
virBitmapPtr numadNodeset = NULL;
virBitmapPtr hostMemoryNodeset = NULL;
int ret = -1; int ret = -1;
/* Get the advisory nodeset from numad if 'placement' of /* Get the advisory nodeset from numad if 'placement' of
...@@ -5188,19 +5190,30 @@ qemuProcessPrepareDomainNUMAPlacement(virDomainObjPtr vm, ...@@ -5188,19 +5190,30 @@ qemuProcessPrepareDomainNUMAPlacement(virDomainObjPtr vm,
if (!nodeset) if (!nodeset)
goto cleanup; goto cleanup;
if (!(hostMemoryNodeset = virNumaGetHostMemoryNodeset()))
goto cleanup;
VIR_DEBUG("Nodeset returned from numad: %s", nodeset); VIR_DEBUG("Nodeset returned from numad: %s", nodeset);
if (virBitmapParse(nodeset, &priv->autoNodeset, VIR_DOMAIN_CPUMASK_LEN) < 0) if (virBitmapParse(nodeset, &numadNodeset, VIR_DOMAIN_CPUMASK_LEN) < 0)
goto cleanup; goto cleanup;
if (!(priv->autoCpuset = virCapabilitiesGetCpusForNodemask(caps, /* numad may return a nodeset that only contains cpus but cgroups don't play
priv->autoNodeset))) * well with that. Set the autoCpuset from all cpus from that nodeset, but
* assign autoNodeset only with nodes containing memory. */
if (!(priv->autoCpuset = virCapabilitiesGetCpusForNodemask(caps, numadNodeset)))
goto cleanup; goto cleanup;
virBitmapIntersect(numadNodeset, hostMemoryNodeset);
VIR_STEAL_PTR(priv->autoNodeset, numadNodeset);
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(nodeset); VIR_FREE(nodeset);
virBitmapFree(numadNodeset);
virBitmapFree(hostMemoryNodeset);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册