Announcement

Collapse
No announcement yet.

LZ4 Compression For Hibernation Images Queued For Linux 6.9: Faster Restore Times

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

  • LZ4 Compression For Hibernation Images Queued For Linux 6.9: Faster Restore Times

    Phoronix: LZ4 Compression For Hibernation Images Queued For Linux 6.9: Faster Restore Times

    In development the past several months has been patches to allow changing the compression algorithm used by the hibernation images of the Linux kernel while preserving the system memory contents. With using LZ4 yields faster system restore times from hibernation than the current de facto compression algorithm used of LZO. This work is now queued for introduction in Linux 6.9...

    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
    So a 0.6 sec difference between LZO and LZ4 in restore times.

    Ok, LZ4 is now faster and this improvement is a respectable achievement, but such a small difference is almost a *yawn* when it comes to news IMHO.

    After all, what can you really do in 0.6 seconds ... and still keep it safe for work?
    Last edited by NotMine999; 13 February 2024, 09:45 PM. Reason: why not?

    Comment


    • #3
      Originally posted by NotMine999 View Post
      So a 0.6 sec difference between LZO and LZ4 in restore times.

      Ok, LZ4 is now faster and this improvement is a respectable achievement, but such a small difference is almost a *yawn* when it comes to news IMHO.

      After all, what can you really do in 0.6 seconds ... and still keep it safe for work?
      Well, it's a test of ~682MB. That's not necessarily a large amount of data to test against when compared against modern RAM sizes. Like you point out, at that size it's hardly an improvement, however, using their reported averages, LZO's 335 MB/s versus LZ4's 501 MB/s will have more of an affect at both the hibernation and restore times on laptops that have 16GB or more RAM. It's ~33 seconds and ~49 seconds, a 16 second difference, at 16GB; ~65 and ~98 seconds, 33 second difference, at 32GB.

      So, using bar math, (Size in GB x 1024)/Compressor Restore Speed in MB/s, you basically save a small hair over 1 second per gigabyte of restore time. It adds up.
      Last edited by skeevy420; 13 February 2024, 10:49 PM.

      Comment


      • #4
        Originally posted by NotMine999 View Post
        So a 0.6 sec difference between LZO and LZ4 in restore times.

        Ok, LZ4 is now faster and this improvement is a respectable achievement, but such a small difference is almost a *yawn* when it comes to news IMHO.

        After all, what can you really do in 0.6 seconds ... and still keep it safe for work?
        It's a ~50% increase in decompression rate so it seems like a nice gain.

        (501.05 - 335.02) / 335.02 = 49.55%

        And it's cool that it's more generic now so it's easy to plug in other compressors in the future if there's a benefit.

        Comment


        • #5
          Tangentially related, but are they still making progress on signed hibernation images so that flow works with Secure Boot on / kernel lockdown mode enabled?

          Comment


          • #6
            It looks like total restore time isn't related to decompression speed in linear fashion, so the actual difference is lower than speed difference might suggest. Probably image load is a just a fraction of whole process.
            Also, hibernation doesn't seem to save caches, only program data. So it's very unlikely 16GB laptop will ever have 16GB hibernation image.
            And LZ4 will wear your SSD a little bit faster if you hibernate often. With QLC drives, zstd might be a better option.

            Comment


            • #7
              Nice, but why no zstd? I'm using zstd for my initramfs with "-6 --long​" which seems to be the best compromise between (de)-compression speed and file size on my hardware.

              Originally posted by sobrus View Post
              And LZ4 will wear your SSD a little bit faster if you hibernate often. With QLC drives, zstd might be a better option.
              Why would it? If it compresses better, it causes less writes to the SSD.
              Last edited by Anux; 14 February 2024, 04:21 AM.

              Comment


              • #8
                Originally posted by Anux View Post
                Why would it? If it compresses better, it causes less writes to the SSD.
                LZ4 compression ratio is usually slightly lower than LZO.

                Comment


                • #9
                  Originally posted by sobrus View Post

                  LZ4 compression ratio is usually slightly lower than LZO.
                  Seems to depend on the compression level used: https://catchchallenger.herman-brule..._vs_LZ4_vs_LZO

                  Comment


                  • #10
                    Originally posted by Anux View Post
                    Yup, but I'm basing my remark on the article we're commenting. I'm not sure whether compression level will be switchable and there, LZ4 performed slightly worse.
                    Granted, I'm not expecting 128GB RAM paired with 160TBW QLC drive

                    Comment

                    Working...
                    X