mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
numa: Rename virNumaGetHostNodeset and make it return only nodes with memory
Name it virNumaGetHostMemoryNodeset and return only NUMA nodes which have memory installed. This is necessary as the kernel is not very happy to set the memory cgroup setting for nodes which do not have any memory. This would break vcpu hotplug with following message on such configruation: Invalid value '0,8' for 'cpuset.mems': Invalid argument Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1375268
This commit is contained in:
parent
5555dc0d7f
commit
77cb01bc0f
@ -2059,7 +2059,7 @@ virNodeSuspendGetTargetMask;
|
|||||||
# util/virnuma.h
|
# util/virnuma.h
|
||||||
virNumaGetAutoPlacementAdvice;
|
virNumaGetAutoPlacementAdvice;
|
||||||
virNumaGetDistances;
|
virNumaGetDistances;
|
||||||
virNumaGetHostNodeset;
|
virNumaGetHostMemoryNodeset;
|
||||||
virNumaGetMaxNode;
|
virNumaGetMaxNode;
|
||||||
virNumaGetNodeMemory;
|
virNumaGetNodeMemory;
|
||||||
virNumaGetPageInfo;
|
virNumaGetPageInfo;
|
||||||
|
@ -860,7 +860,7 @@ qemuRestoreCgroupState(virDomainObjPtr vm)
|
|||||||
virBitmapPtr all_nodes;
|
virBitmapPtr all_nodes;
|
||||||
virCgroupPtr cgroup_temp = NULL;
|
virCgroupPtr cgroup_temp = NULL;
|
||||||
|
|
||||||
if (!(all_nodes = virNumaGetHostNodeset()))
|
if (!(all_nodes = virNumaGetHostMemoryNodeset()))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!(mem_mask = virBitmapFormat(all_nodes)))
|
if (!(mem_mask = virBitmapFormat(all_nodes)))
|
||||||
@ -1166,7 +1166,7 @@ qemuCgroupEmulatorAllNodesAllow(virCgroupPtr cgroup,
|
|||||||
!virCgroupHasController(cgroup, VIR_CGROUP_CONTROLLER_CPUSET))
|
!virCgroupHasController(cgroup, VIR_CGROUP_CONTROLLER_CPUSET))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!(all_nodes = virNumaGetHostNodeset()))
|
if (!(all_nodes = virNumaGetHostMemoryNodeset()))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!(all_nodes_str = virBitmapFormat(all_nodes)))
|
if (!(all_nodes_str = virBitmapFormat(all_nodes)))
|
||||||
|
@ -987,10 +987,17 @@ virNumaNodesetIsAvailable(virBitmapPtr nodeset)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* virNumaGetHostMemoryNodeset:
|
||||||
|
*
|
||||||
|
* Returns a bitmap of guest numa node ids that contain memory.
|
||||||
|
*/
|
||||||
virBitmapPtr
|
virBitmapPtr
|
||||||
virNumaGetHostNodeset(void)
|
virNumaGetHostMemoryNodeset(void)
|
||||||
{
|
{
|
||||||
int maxnode = virNumaGetMaxNode();
|
int maxnode = virNumaGetMaxNode();
|
||||||
|
unsigned long long nodesize;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
virBitmapPtr nodeset = NULL;
|
virBitmapPtr nodeset = NULL;
|
||||||
|
|
||||||
@ -1004,7 +1011,9 @@ virNumaGetHostNodeset(void)
|
|||||||
if (!virNumaNodeIsAvailable(i))
|
if (!virNumaNodeIsAvailable(i))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ignore_value(virBitmapSetBit(nodeset, i));
|
/* if we can't detect NUMA node size assume that it's present */
|
||||||
|
if (virNumaGetNodeMemory(i, &nodesize, NULL) < 0 || nodesize > 0)
|
||||||
|
ignore_value(virBitmapSetBit(nodeset, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
return nodeset;
|
return nodeset;
|
||||||
|
@ -33,7 +33,7 @@ char *virNumaGetAutoPlacementAdvice(unsigned short vcups,
|
|||||||
int virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mode,
|
int virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mode,
|
||||||
virBitmapPtr nodeset);
|
virBitmapPtr nodeset);
|
||||||
|
|
||||||
virBitmapPtr virNumaGetHostNodeset(void);
|
virBitmapPtr virNumaGetHostMemoryNodeset(void);
|
||||||
bool virNumaNodesetIsAvailable(virBitmapPtr nodeset);
|
bool virNumaNodesetIsAvailable(virBitmapPtr nodeset);
|
||||||
bool virNumaIsAvailable(void);
|
bool virNumaIsAvailable(void);
|
||||||
int virNumaGetMaxNode(void);
|
int virNumaGetMaxNode(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user