zswap – compcache, compressed swap for better performance

2013-11-17 291 words 2 mins read

First, here is a link to article on compcache.

http://code.google.com/p/compcache/wiki/CompilingAndUsingNew

zswap is already in the kernel and you can see the documentation in the kernel documentation. Here is the name of the file if you need:

/usr/share/doc/kernel-doc-$(uname -r)/Documentation/vm/zswap.txt

Here is the overview, in case you do not want to install kernel-doc

Overview:

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.

NOTE: Zswap is a new feature as of v3.11 and interacts heavily with memory
reclaim.  This interaction has not be fully explored on the large set of
potential configurations and workloads that exist.  For this reason, zswap
is a work in progress and should be considered experimental.

Some potential benefits:

  • Desktop/laptop users with limited RAM capacities can mitigate the
        performance impact of swapping.
  • Overcommitted guests that share a common I/O resource can
        dramatically reduce their swap I/O pressure, avoiding heavy handed I/O
        throttling by the hypervisor. This allows more work to get done with less
        impact to the guest workload and guests sharing the I/O subsystem
  • Users with SSDs as swap devices can extend the life of the device by
        drastically reducing life-shortening writes.

Zswap evicts pages from compressed cache on an LRU basis to the backing swap
device when the compressed pool reaches it size limit.  This requirement had
been identified in prior community discussions.

To enabled zswap, the “enabled” attribute must be set to 1 at boot time.  e.g.
zswap.enabled=1

 

Enhanced by Zemanta

author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it