Announcement

Collapse
No announcement yet.

Zswap: Compressed Swap Caching For Linux

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    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 December 2012, 10:43 PM. Reason: Added benchmarks link

    Comment


    • #3
      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.

      Comment


      • #4
        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.

        Comment


        • #5
          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...

          Comment


          • #6
            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.

            Comment


            • #7
              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; 13 December 2012, 07:41 AM.

              Comment


              • #8
                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.

                Comment


                • #9
                  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.

                  Comment


                  • #10
                    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.

                    Comment

                    Working...
                    X