Linux KSM: Kernel Samepage Merging / Kernel Shared Memory

Kernel 2.6+ have ksm feature that allows kernel to dedup pages across processes. This could lead to decent memory saving especially on a host OS in a virtual machines environment.

Ubuntu 12.04 kernel has KSM support, but it is not enabled.

$ cat /etc/issue
Ubuntu 12.04.4 LTS \n \l

$ grep KSM /boot/config-`uname -r`
CONFIG_KSM=y

$ ll /sys/kernel/mm/ksm/
total 0
drwxr-xr-x 2 root root    0 Feb 12 19:27 ./
drwxr-xr-x 6 root root    0 Feb 12 19:27 ../
-r–r–r– 1 root root 4096 Feb 12 19:29 full_scans
-r–r–r– 1 root root 4096 Feb 12 19:29 pages_shared
-r–r–r– 1 root root 4096 Feb 12 19:29 pages_sharing
-rw-r–r– 1 root root 4096 Feb 12 19:29 pages_to_scan
-r–r–r– 1 root root 4096 Feb 12 19:29 pages_unshared
-r–r–r– 1 root root 4096 Feb 12 19:29 pages_volatile
-rw-r–r– 1 root root 4096 Feb 12 19:27 run
-rw-r–r– 1 root root 4096 Feb 12 19:29 sleep_millisecs

Refernces

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s