9.4. NUMA-Aware Kernel SamePage Merging (KSM)


Kernel SamePage Merging (KSM) allows virtual machines to share identical memory pages. From Red Hat Enterprise Linux 6.5, 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.3.2, “Memory Tuning with virsh”.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.