From: Daniel Vacek <neelx@suse.com>
To: dsterba@suse.cz
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>, Nick Terrell <terrelln@fb.com>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] btrfs/zstd: enable negative compression levels mount option
Date: Mon, 10 Feb 2025 09:18:05 +0100 [thread overview]
Message-ID: <CAPjX3FfCgtUcrTiui8VW=bPC9fdrUqa65dCDeymk+=jnFOYWFA@mail.gmail.com> (raw)
In-Reply-To: <20250205164012.GJ5777@suse.cz>
On Wed, 5 Feb 2025 at 17:40, David Sterba <dsterba@suse.cz> wrote:
>
> On Thu, Jan 30, 2025 at 10:13:36AM +0100, Daniel Vacek wrote:
> > On Wed, 29 Jan 2025 at 23:42, David Sterba <dsterba@suse.cz> wrote:
> > > Up to -15 it's 3x improvement which translates to about 33% of the
> > > original size. And this is only for rough estimate, kernel compression
> > > could be slightly worse due to slightly different parameters.
> > >
> > > We can let it to -15, so it's same number as the upper limit.
> >
> > I was getting less favorable results with my testing which leads me to
> > the ultimate rhetorical question:
> >
> > What do we know about the dataset users are possibly going to apply?
>
> This does not need to be a rhetorical question, this is what needs to be
> asked when adding a new feature or use case. We do not know exactly but
> in this case we can evaluate expected types of data regarding
> compressibility, run benchmarks and do some predictions.
>
> > And how do you want to assess the right cut-off having incomplete
> > information about the nature of the data?
>
> Analyze typical use cases, suggest a solution, evaluate and either take
> it or repeat.
OK.
> > Why doesn't zstd enforce any limit itself?
>
> That can be answered by ZSTD people, that the realtime level number
> translates to the internal parameters may be an outlier because the
> normal level are defined in a big table that specifically defines what
> each level should do so there's not predictable pattern.
>
> https://elixir.bootlin.com/linux/v6.13.1/source/lib/zstd/compress/clevels.h#L23
Yeah, I'm aware of this.
> > Is this even a matter (or responsibility) of the filesystem to force
> > some arbitrary limit here? Maybe yes?
>
> Yes and this is for practical reasons.
>
> > As mentioned before, personally I'd leave it to the users so that they
> > can freely choose whatever suits them the best. I don't see any
> > technical or maintenance issues opening this limit.
>
> As a user I see an unbounded number for relatime limit level and have no
> idea which one to use. So I go to the documentation and see that
> somebody evaluated the levels on various data sets with description of
> compressibility and says that levels -1 and -15 can give some reasonable
> results. I can also reevaluate it for my own data set or take some
> recommendation.
>
> What would IMHO look really strange is to see another 1000 levels
> allowed by the parameter but docuented as "no obvious benefit, only
> extra overhead".
>
> If somebody comes later with a concrete numbers that it would be good to
> have a few more levels allowed we can talk about it and adjust it again.
Right, agreed.
> The level is currently not stored anywhere but we will want that
> eventually for the properties so limiting the number is necessay anyway.
> So this is a technical and compatibility reason.
I was looking into properties as well and I have a draft using 8 bits
for the level value. I think we can stick to that for now.
prev parent reply other threads:[~2025-02-10 8:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-24 7:55 Daniel Vacek
2025-01-27 18:02 ` David Sterba
2025-01-28 8:46 ` Daniel Vacek
2025-01-29 22:42 ` David Sterba
2025-01-30 9:13 ` Daniel Vacek
2025-02-05 16:40 ` David Sterba
2025-02-10 8:18 ` Daniel Vacek [this message]
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='CAPjX3FfCgtUcrTiui8VW=bPC9fdrUqa65dCDeymk+=jnFOYWFA@mail.gmail.com' \
--to=neelx@suse.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=dsterba@suse.cz \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®