Zswap Merged Into The Linux 3.11 Kernel

Written by Michael Larabel in Free Software on 11 July 2013 at 01:31 AM EDT. 10 Comments
FREE SOFTWARE
Zswap is a feature for the Linux kernel that provides compressed swap caching. It's been in development for a long time and was finally merged into the mainline Linux kernel for the 3.11 release.

Making the Linux 3.11 kernel an even more exciting release was the merger on Wednesday of the Zswap support. Per the Linux kernel documentation, "Zswap is a lightweight compressed cache for swap pages. It takes pages that are in the process of being swapped out and attempts to compress them into a dynamically allocated RAM-based memory pool. zswap basically trades CPU cycles for potentially reduced swap I/O. This trade-off can also result in a significant performance improvement if reads from the compressed cache are faster than reads from a swap device."

Among potentially beneficial scenarios are desktop/laptops with limited RAM, overcommitted virtualization guests sharing common I/O resources, and users with SSDs as swap devices can extend their devices life by shortening writes. With the Kconfig ZSWAP support for Zswap enabled, it's just a matter of setting zswap.enabled=1 as a kernel module parameter.

As part of the Zswap work, Zbud was also added to the kernel tree for 3.11. Zbud is a special purpose memory allocator for storing compressed pages. This allocator is a rewrite of the Zbud code found in Zcache.

The merge to mainline of Zswap happened with this commit. "Zswap is a thin backend for frontswap that takes pages that are in the process of being swapped out and attempts to compress them and store them in a RAM-based memory pool."
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week