In Brief: Linux 2.6.32 - KSM and KVM

Can you imagine to have 52 Windows XP virtual machines - 1GB RAM each - running on a server with just 16GB? Ok, sounds a lot… but we are near the 16GB barrier. Anyway, this is one of the features in the new 2.6.32 release. Its called Kernel Samepage Merging, KSM.

The approach is you start more than one VM and tell the kernel that they probably will use identically memory segments. Than the kernel scans for them and if one is found, it will be kind of hardlinked and the double memory will be freed - imagine that for a lot of same (eg. WinXP) VMs. But its not only useable for KVM - you can use the syscall wherever you think its applicable and is not already done via a shared library.

More information on KSM can be found at Linux Kernel Newbies.