Show Table of Contents
9.4. NUMA-Aware Kernel SamePage Merging (KSM)
Kernel SamePage Merging (KSM) allows virtual machines to share identical memory pages. KSM can detect that a system is using NUMA memory and control merging pages across different NUMA nodes.
Use the
sysfs /sys/kernel/mm/ksm/merge_across_nodes parameter to control merging of pages across different NUMA nodes. By default, pages from all nodes can be merged together. When this parameter is set to zero, only pages from the same node are merged.
Generally, unless you are oversubscribing the system memory, you will get better runtime performance by disabling KSM sharing.
Important
When KSM merges across nodes on a NUMA host with multiple guest virtual machines, guests and CPUs from more distant nodes can suffer a significant increase of access latency to the merged KSM page.
To instruct the hypervisor to disable share pages for a guest, add the following to the guest's XML:
<memoryBacking>
<nosharepages/>
</memoryBacking>
For more information about tuning memory settings with the
<memoryBacking> element, see Section 8.2.2, “Memory Tuning with virsh”.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.