Zswap

zswap
Developer(s)Seth Jennings and others
Initial releaseSeptember 2, 2013; 11 years ago (2013-09-02) (Linux 3.11)
Written inC
Operating systemLinux
TypeLinux kernel features
LicenseGNU GPL
Websitekernel.org

zswap is a Linux kernel feature that provides a compressed write-back cache for swapped pages, as a form of virtual memory compression. Instead of moving memory pages to a swap device when they are to be swapped out, zswap performs their compression and then stores them into a memory pool dynamically allocated in the system RAM. Later writeback to the actual swap device is deferred or even completely avoided, resulting in a significantly reduced I/O for Linux systems that require swapping; the tradeoff is the need for additional CPU cycles to perform the compression.[1][2][3]

As a result of reduced I/O, zswap offers advantages to various devices that use flash-based storage, including embedded devices, netbooks and similar low-end hardware devices, as well as to other devices that use solid-state drives (SSDs) for storage. Flash memory has a limited lifespan due to its nature, so avoiding it to be used for providing swap space prevents it from wearing out quickly.[4]

  1. ^ Seth Jennings (February 12, 2013). "The zswap compressed swap cache". LWN.net. Retrieved January 22, 2014.
  2. ^ Jenifer Hopper (December 11, 2012). "New Linux zswap compression functionality". IBM. Retrieved January 31, 2014.
  3. ^ Michael Larabel (July 11, 2013). "Zswap Merged Into The Linux 3.11 Kernel". Phoronix. Retrieved February 5, 2014.
  4. ^ "Linux kernel documentation: Documentation/vm/zswap.txt". kernel.org. November 22, 2013. Retrieved January 22, 2014.