Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

9.2. NUMA Memory Allocation Policies

The following policies define how memory is allocated from the nodes in a system:
Strict
Strict policy means that the allocation will fail if the memory cannot be allocated on the target node.
Specifying a NUMA nodeset list without defining a memory mode attribute defaults to strict mode.
Interleave
Memory pages are allocated across nodes specified by a nodeset, but are allocated in a round-robin fashion.
Preferred
Memory is allocated from a single preferred memory node. If sufficient memory is not available, memory can be allocated from other nodes.
To enable the desired policy, set it as the value of the <memory mode> element of the domain XML file:
<numatune>
	<memory mode='preferred' nodeset='0'>
</numatune>

Important

If memory is overcommitted in strict mode and the guest does not have sufficient swap space, the kernel will kill some guest processes to retrieve additional memory. Red Hat recommends using preferred allocation and specifying a single nodeset (for example, nodeset='0') to prevent this situation.