public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Eric Biggers <ebiggers@kernel.org>
Cc: David Sterba <dsterba@suse.cz>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"Cabiddu, Giovanni" <giovanni.cabiddu@intel.com>,
	Josef Bacik <josef@toxicpanda.com>, "clm@fb.com" <clm@fb.com>,
	"dsterba@suse.com" <dsterba@suse.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	qat-linux <qat-linux@intel.com>, "embg@meta.com" <embg@meta.com>,
	"Collet, Yann" <cyan@meta.com>,
	"Will, Brian" <brian.will@intel.com>,
	"Li, Weigang" <weigang.li@intel.com>
Subject: Re: [RFC PATCH 6/6] btrfs: zlib: add support for zlib-deflate through acomp
Date: Mon, 12 May 2025 19:52:46 +0200	[thread overview]
Message-ID: <20250512175245.GV9140@twin.jikos.cz> (raw)
In-Reply-To: <20250508041914.GA669573@sol>

On Wed, May 07, 2025 at 09:19:14PM -0700, Eric Biggers wrote:
> On Wed, May 07, 2025 at 02:17:54PM +0200, David Sterba wrote:
> > Anyway, assuming there will be a maintained, packaged in distros and
> > user friendly tool to tweak the linux crypto subsystem I agree we don't
> > have to do it in the filesystem or other subsystems.
> 
> I don't think there ever will be.  NETLINK_CRYPTO is obscure and hardly anyone
> uses it.  The kernel's generic crypto infrastructure is also really cumbersome
> to use, so the trend in the kernel overall has been a move away from the generic
> crypto infrastructure and towards straightforward library APIs (e.g.
> lib/crypto/) that just do the right thing with no configuration needed.

Ok, so on hand the recommendation is to use an obscure tool and
interface and ont the other hand kernel is moving towards library API.
I don't mind using the library approach, as long as it provides the
automatic selection of the fastest implementation available (it could be
even an extra API call e.g. at mount time).

> btrfs already uses the compression library APIs.  Considering how disastrous
> crypto_acomp has been so far when other people tried to use it, most likely the
> right decision will be to keep using the library APIs for the vast majority of
> btrfs users, and have an alternative code path that uses crypto_acomp only when
> hardware offload is actually being used.

No problem with that. I once had a prototype to do async checksumming
and using the ahash was indeed cumbersome, with the mempools and request
handling to avoid deadlocks.

> There may also be a way to rework things so that the compression library APIs
> can use hardware offload, in which case the crypto API would play no role at
> all.  I understand the Zstandard library in userspace can use Intel QAT as an
> external sequence provider, so it's been proven that this can be done.

As along as the switch to library or QAT can be in a wrapper I don't
mind.

> BTW, I also have to wonder why this patchset is proposing accelerating zlib
> instead of Zstandard.  Zstandard is a much more modern algorithm.

I think the plan is to support zstd as well but the QAT integration
should be simpler on zlib. I'd like to see some up to date code first to
get better idea of what and how.

  reply	other threads:[~2025-05-12 17:52 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 10:54 [RFC PATCH 0/6] btrfs: offload zlib-deflate to accelerators Giovanni Cabiddu
2024-04-26 10:54 ` [RFC PATCH 1/6] Revert "crypto: testmgr - Remove zlib-deflate" Giovanni Cabiddu
2024-04-26 10:54 ` [RFC PATCH 2/6] Revert "crypto: deflate " Giovanni Cabiddu
2024-04-26 10:54 ` [RFC PATCH 3/6] Revert "crypto: qat " Giovanni Cabiddu
2024-04-26 10:54 ` [RFC PATCH 4/6] Revert "crypto: qat - remove unused macros in qat_comp_alg.c" Giovanni Cabiddu
2024-04-26 10:54 ` [RFC PATCH 5/6] crypto: qat - change compressor settings for QAT GEN4 Giovanni Cabiddu
2024-04-26 10:54 ` [RFC PATCH 6/6] btrfs: zlib: add support for zlib-deflate through acomp Giovanni Cabiddu
2024-04-29 13:56   ` Josef Bacik
2024-04-29 15:21     ` Cabiddu, Giovanni
2024-04-29 15:44       ` David Sterba
2024-05-03 10:04       ` Herbert Xu
2024-04-29 15:41     ` David Sterba
2025-05-06 15:38       ` Cabiddu, Giovanni
2025-05-07  2:23         ` Herbert Xu
2025-05-07 12:17           ` David Sterba
2025-05-08  4:19             ` Eric Biggers
2025-05-12 17:52               ` David Sterba [this message]
2025-05-27  2:32               ` Gao Xiang
2025-05-27  2:45                 ` Gao Xiang
2025-05-27 11:17                 ` David Sterba
2025-05-27 12:08                   ` Gao Xiang
2025-05-07 12:43         ` David Sterba
2025-05-07 13:12           ` Cabiddu, Giovanni
2024-04-29 15:57   ` David Sterba

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=20250512175245.GV9140@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=brian.will@intel.com \
    --cc=clm@fb.com \
    --cc=cyan@meta.com \
    --cc=dsterba@suse.com \
    --cc=ebiggers@kernel.org \
    --cc=embg@meta.com \
    --cc=giovanni.cabiddu@intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=qat-linux@intel.com \
    --cc=weigang.li@intel.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