linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
To: Nick Terrell <terrelln@fb.com>, Adam Borowski <kilobyte@angband.pl>
Cc: "dsterba@suse.cz" <dsterba@suse.cz>, E V <eliventer@gmail.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>,
	Yann Collet <cyan@fb.com>
Subject: Re: [PATCH v2 3/4] btrfs: Add zstd support
Date: Thu, 6 Jul 2017 07:59:53 -0400	[thread overview]
Message-ID: <44461d9f-f21f-c346-df0a-5ee4e7bf838d@gmail.com> (raw)
In-Reply-To: <3457CD72-ECD7-4E07-A297-7AE426BF39C1@fb.com>

On 2017-07-05 20:25, Nick Terrell wrote:
> On 7/5/17, 12:57 PM, "Austin S. Hemmelgarn" <ahferroin7@gmail.com> wrote:
>> It's the slower compression speed that has me arguing for the
>> possibility of configurable levels on zlib.  11MB/s is painfully slow
>> considering that most decent HDD's these days can get almost 5-10x that
>> speed with no compression.  There are cases (WORM pattern archival
>> storage for example) where slow writes to that degree may be acceptable,
>> but for most users they won't be, and zlib at level 9 would probably be
>> a better choice.  I don't think it can beat zstd at level 15 for
>> compression ratio, but if they're even close, then zlib would still be a
>> better option at that high of a compression level most of the time.
> 
> I don't imagine the very high zstd levels would be useful to too many
> btrfs users, except in rare cases. However, lower levels of zstd should
> outperform zlib level 9 in all aspects except memory usage. I would expect
> zstd level 7 would compress as well as or better than zlib 9 with faster
> compression and decompression speed. It's worth benchmarking to ensure that
> it holds for many different workloads, but I wouldn't expect zlib 9 to
> compress better than zstd 7 often. zstd up to level 12 should compress as
> fast as or faster than zlib level 9. zstd levels 12 and beyond allow
> stronger compression than zlib, at the cost of slow compression and more
> memory usage.
While I generally agree that most people probably won't use zstd levels 
above 3, it shouldn't be hard to support them if we're going to have 
configurable compression levels, so I would argue that it's still worth 
supporting anyway.

Looking at it another way, ZFS (at least, ZFS on FreeBSD) supports zlib 
compression (they call it gzip) with selectable compression levels, but 
95% of the time nobody uses anything but levels 1, 3, and 9.  Despite 
this, they still support other levels, and I have seen cases where other 
levels have been better than one of those three 'normal' ones.
> 
> Supporting multiple zlib compression levels could be intersting for older
> kernels, lower memory usage, or backwards compatibility with older btrfs
> versions. But for every zlib level, zstd has a level that provides better
> compression ratio, compression speed, and decompression speed.
Just the memory footprint is a remarkably strong argument in many cases. 
  It appears to be one of the few things that zlib does better than zstd 
(although I'm not 100% certain about that), and can make a very big 
difference when dealing with small systems.

  reply	other threads:[~2017-07-06 11:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29 19:41 [PATCH v2 0/4] Add xxhash and zstd modules Nick Terrell
2017-06-29 19:41 ` [PATCH v2 1/4] lib: Add xxhash module Nick Terrell
2017-06-29 19:41 ` [PATCH v2 3/4] btrfs: Add zstd support Nick Terrell
2017-06-30  3:24   ` Adam Borowski
2017-06-30 12:16   ` E V
2017-06-30 14:21     ` David Sterba
2017-06-30 18:25       ` Austin S. Hemmelgarn
2017-06-30 23:01         ` Nick Terrell
2017-07-05 11:43           ` Austin S. Hemmelgarn
2017-07-05 18:18             ` Adam Borowski
2017-07-05 18:45               ` Austin S. Hemmelgarn
2017-07-05 19:35                 ` Nick Terrell
2017-07-05 19:57                   ` Austin S. Hemmelgarn
2017-07-06  0:25                     ` Nick Terrell
2017-07-06 11:59                       ` Austin S. Hemmelgarn [this message]
2017-07-06 12:09                         ` Lionel Bouton
2017-07-06 12:27                           ` Austin S. Hemmelgarn
2017-07-10 21:11     ` Clemens Eisserer
2017-07-06 16:32   ` Adam Borowski
2017-07-07 23:17     ` Nick Terrell
2017-07-07 23:40       ` Adam Borowski
2017-07-08  3:07         ` Adam Borowski
2017-07-10 12:36           ` Austin S. Hemmelgarn
2017-07-10 20:57             ` Nick Terrell
2017-07-11  4:57             ` Nick Terrell
2017-07-11  6:01               ` Nick Terrell
2017-07-12  3:38                 ` Adam Borowski
2017-07-18 18:21   ` David Sterba
2017-06-29 19:41 ` [PATCH v2 4/4] squashfs: " Nick Terrell
2017-06-30  7:36 ` [PATCH v2 0/4] Add xxhash and zstd modules David Sterba
2017-06-30 16:46 ` Timofey Titovets
2017-06-30 19:52   ` Nick Terrell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44461d9f-f21f-c346-df0a-5ee4e7bf838d@gmail.com \
    --to=ahferroin7@gmail.com \
    --cc=cyan@fb.com \
    --cc=dsterba@suse.cz \
    --cc=eliventer@gmail.com \
    --cc=kilobyte@angband.pl \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=terrelln@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).