Kernel same-page merging

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

In computing, kernel same-page merging (abbreviated as KSM, and also known as kernel shared memory and memory merging) is a kernel feature that makes it possible for a hypervisor system to share identical memory pages amongst different processes or virtualized guests. While not directly linked, Kernel-based Virtual Machine (KVM) can use KSM to merge memory pages occupied by virtual machines.

KSM performs the memory sharing by scanning through the main memory and finding duplicate pages. Each detected duplicate pair is then merged into a single page, and mapped into both original locations. The page is also marked as "copy-on-write" (COW), so the kernel will automatically separate them again should one process modify its data.[1]

KSM was originally intended to run more virtual machines on one host by sharing memory between processes as well as virtual machines. Upon its implementation, different users found KSM to also be useful for non-virtualized environments in which memory is at a premium.[2][3] An experimental implementation of KSM by Red Hat found that 52 virtual instances of Windows XP with 1 GB of memory, could run on a host computer that had only 16 GB of RAM.[4]

KSM was merged into the Linux kernel mainline in kernel version 2.6.32, which was released on December 3, 2009.[2][4] To be effective, the operating system kernel must find identical memory pages held by different processes. The kernel also needs to decide whether the pages are going to update infrequently enough that the merging would be an efficient use of processor resources.[3] A concern is that although memory usage is reduced, CPU usage is increased, thus negating potential increases in performance.[1] Another concern is that KSM may pose security risks, such as allowing circumvention of address space layout randomization (ASLR).[5][6]

References

  1. 1.0 1.1 Lua error in package.lua at line 80: module 'strict' not found.
  2. 2.0 2.1 Lua error in package.lua at line 80: module 'strict' not found.
  3. 3.0 3.1 Lua error in package.lua at line 80: module 'strict' not found.
  4. 4.0 4.1 Lua error in package.lua at line 80: module 'strict' not found.
  5. Lua error in package.lua at line 80: module 'strict' not found.
  6. Lua error in package.lua at line 80: module 'strict' not found.

External links