Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Zswap: Compressed Swap Caching For Linux

  1. #1
    Join Date
    Jan 2007
    Posts
    14,837

    Default Zswap: Compressed Swap Caching For Linux

    Phoronix: Zswap: Compressed Swap Caching For Linux

    Published to the Linux kernel mailing list were a set of patches to provide a new feature called Zswap for lightweight compressed swap caching...

    http://www.phoronix.com/vr.php?view=MTI1MDM

  2. #2
    Join Date
    Dec 2007
    Posts
    677

    Default

    This seems like a very solid idea for HDDs, given how swap IO completely kills a desktop Linux-based OS. Reducing the time would be an improvement.

    Benchmarks - http://ibm.co/VCgHvM
    Last edited by Vadi; 12-12-2012 at 09:43 PM. Reason: Added benchmarks link

  3. #3
    Join Date
    Sep 2009
    Posts
    119

    Default

    Funny how these things work out. Earlier today, I was thinking that compressing swapped data before actually writing it to the swap device might reduce the demand on the HDD's throughput and provide a marginal performance gain.

    Now I feel silly. This is obviously a much better idea.

    Of course, I haven't had a swap partition configured on my computer for a couple of years now. I'd much rather suffer the occasional OOM crash instead of frequent lag caused by swapping.

  4. #4
    Join Date
    Dec 2010
    Location
    MA, USA
    Posts
    1,318

    Default

    kinda ironic, because isnt one of the perks about compressing data that it takes up a lot of ram and CPU power in favor of faster loading and smaller disk consumption? anyways, while I'm sure there's some huge technical detail I'm not aware of, I think this kind of thing came a few years too late. RAM is really cheap nowadays, I'd rather buy another GB or 2 than use a swap partition.

  5. #5
    Join Date
    Mar 2011
    Posts
    92

    Default

    Quote Originally Posted by schmidtbag View Post
    RAM is really cheap nowadays, I'd rather buy another GB or 2 than use a swap partition.
    Ram is cheap for a new PCs and if one has in his possesion machine that has few years than it might be quite a different story especially if place where place one lives has GDP much lower than US or Western Europe therefore IMHO it is never to late for this kind of development. Besides who is not to say that in 5 years one would not need 10 times more RAM for basic work like to display some new 3D desktop, manufactures use some excuse to increase prices of parts like it was with HDDs and flooding and it would make You think again about Zswap...

  6. #6

    Default

    RAM may be cheap and you may want to add some more RAM, but that's not the point. Even if you could add RAM you can still use a compressed swap device that can improve performance.

  7. #7
    Join Date
    Apr 2009
    Posts
    108

    Default

    Oh! I hope Zswap will improve swap and system performance.
    Everyone knows that especially in Linux, when the swap is used the system performance is disastrous. I know this should be normal because the speed of the hard disk, but Linux swap have worse performance compared to other systems who do heavy usage of the paging file. I think this problem is well known in Linux because there is much written on the internet to avoid the swap usage changing the swappiness.
    Last edited by YAFU; 12-13-2012 at 06:41 AM.

  8. #8
    Join Date
    Jan 2012
    Posts
    151

    Default In case anyone else is befuddled...

    I've got a short snippet on each of the z* modules that were/are in development and what their differences are. I guess I'm writing this more for my own sanity, but I like to share with others

    1. compcache (a.k.a. ramzswap): developed by Nitin Gupta, it creates a block device backed by compressed RAM - never made it to main line
    2. zram: a rewrite of compcache
    3. zcache: Nitin Gupta's 2nd attempt to get a RAM compression module into the kernel. It uses the CleanCache framework, which hooks into the page cache and file system code. CleanCache was merged in May 26, 2011 and zCache was merged in October 2011. zcache uses LZO to compress the pages. Unlike zram/compcache, zcache transparently stores the cache pages (no block device).
    4. zswap: written by Seth Jennings under the Unix philosophy of "doing one thing well", it leaves file cache compression and other features for separate code. zswap focuses on managing the compressed memory pool well. It also uses the Frontswap API from which it receives pages. This allows configuration of which compression algorithm to use.

  9. #9
    Join Date
    Jun 2008
    Location
    Perth, Scotland
    Posts
    438

    Default

    Although I don't need it any more, I still use zcache back from when I was running Minecraft server and client on the same machine. My free RAM certainly increased and the game performance improved as it no longer hit swap. There haven't been any problems either.

  10. #10
    Join Date
    Jun 2010
    Location
    Italy
    Posts
    20

    Default

    Quote Originally Posted by FourDMusic View Post
    I've got a short snippet on each of the z* modules that were/are in development and what their differences are. I guess I'm writing this more for my own sanity, but I like to share with others

    1. compcache (a.k.a. ramzswap): developed by Nitin Gupta, it creates a block device backed by compressed RAM - never made it to main line
    2. zram: a rewrite of compcache
    3. zcache: Nitin Gupta's 2nd attempt to get a RAM compression module into the kernel. It uses the CleanCache framework, which hooks into the page cache and file system code. CleanCache was merged in May 26, 2011 and zCache was merged in October 2011. zcache uses LZO to compress the pages. Unlike zram/compcache, zcache transparently stores the cache pages (no block device).
    4. zswap: written by Seth Jennings under the Unix philosophy of "doing one thing well", it leaves file cache compression and other features for separate code. zswap focuses on managing the compressed memory pool well. It also uses the Frontswap API from which it receives pages. This allows configuration of which compression algorithm to use.
    Don't forget latest zcache2 from Dan Magenheimer (with ramster in staging-next drivers).
    Zcache2 was the first attempt to address the problem of zcache that has no writeback to real swap, allowing evcting pages from swap compressed memory to real swap partition.

    Please remember that zcache (or zcache2) tries to dynamically balance both compressed pagecache pages and compressed swap pages against other system memory pressure (and, with ramster, across multiple machines, and with Xen tmem, across multiple Xen guests).

    Zswap is only focused on compressing swap pages: this architecture has the great advantage of being simple.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •