From: David Sterba <dsterba@suse.cz>
To: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Cc: Qu Wenruo <wqu@suse.com>,
clm@fb.com, dsterba@suse.com, terrelln@fb.com,
herbert@gondor.apana.org.au, linux-btrfs@vger.kernel.org,
linux-crypto@vger.kernel.org, qat-linux@intel.com, cyan@meta.com,
brian.will@intel.com, weigang.li@intel.com,
senozhatsky@chromium.org
Subject: Re: [RFC PATCH 16/16] btrfs: add compression hw-accelerated offload
Date: Sat, 29 Nov 2025 02:08:54 +0100 [thread overview]
Message-ID: <20251129010854.GF13846@suse.cz> (raw)
In-Reply-To: <aSok4RiuQVZ8zckR@gcabiddu-mobl.ger.corp.intel.com>
On Fri, Nov 28, 2025 at 10:40:33PM +0000, Giovanni Cabiddu wrote:
> On Sat, Nov 29, 2025 at 08:25:30AM +1030, Qu Wenruo wrote:
> > 在 2025/11/29 05:35, Giovanni Cabiddu 写道:
> > > Add support for hardware-accelerated compression using the acomp API in
> > > the crypto framework, enabling offload of zlib and zstd compression to
> > > hardware accelerators. Hardware offload reduces CPU load during
> > > compression, improving performance.
> > >
> > > The implementation follows a generic design that works with any acomp
> > > implementation, though this enablement targets Intel QAT devices
> > > (similarly to what done in EROFS).
> > >
> > > Input folios are organized into a scatter-gather list and submitted to
> > > the accelerator in a single asynchronous request. The calling thread
> > > sleeps while the hardware performs compression, freeing the CPU for
> > > other tasks. Upon completion, the acomp callback wakes the thread to
> > > continue processing.
> > >
> > > Offload is supported for:
> > > - zlib: compression and decompression
> > > - zstd: compression only
> > >
> > > Offload is only attempted when the data size exceeds a minimum threshold,
> > > ensuring that small operations remain efficient by avoiding hardware setup
> > > overhead. All required buffers are pre-allocated in the workspace to
> > > eliminate allocations in the data path.
> > >
> > > This feature maintains full compatibility with the existing BTRFS disk
> > > format. Files compressed by hardware can be decompressed by software
> > > implementations and vice versa.
> > >
> > > The feature is wrapped in CONFIG_BTRFS_EXPERIMENTAL and can be enabled
> > > at runtime via the sysfs parameter /sys/fs/btrfs/<UUID>/offload_compress.
> >
> > Not an compression/crypto expert, thus just comment on the btrfs part.
> >
> > sysfs is not a good long-term solution. Since it's already behind
> > experiemental flags, you can just enable it unconditionally (with proper
> > checks of-course).
> The reason for introducing a sysfs attribute is to allow disabling the
> feature to be able to unload the QAT driver or to assign a QAT device to
> user space for example to QATlib or DPDK.
>
> In the initial implementation, there was no sysfs switch because the
> acomp tfm was allocated in the data path. With the current design,
> where the tfm is allocated in the workspace, the driver remains
> permanently in use.
>
> Is there any other alternative to a sysfs attribute to dynamically
> enable/disable this feature?
At least for the duration of the experimental phase the sysfs is the
right interface for enabing/disabling the QAT support.
In the long term I'd still recommend sysfs, this is easily accessible by
scripts unlike alternative way of ioctl. I don't know about other
reasonable options for that, certainly not a mount option.
next prev parent reply other threads:[~2025-11-29 1:08 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-28 19:04 [RFC PATCH 00/16] btrfs: offload compression to hardware accelerators Giovanni Cabiddu
2025-11-28 14:25 ` Giovanni Cabiddu
2025-11-28 16:13 ` Chris Mason
2025-11-28 19:04 ` [RFC PATCH 01/16] crypto: zstd - fix double-free in per-CPU stream cleanup Giovanni Cabiddu
2025-11-28 19:04 ` [RFC PATCH 02/16] Revert "crypto: qat - remove unused macros in qat_comp_alg.c" Giovanni Cabiddu
2025-11-28 19:04 ` [RFC PATCH 03/16] Revert "crypto: qat - Remove zlib-deflate" Giovanni Cabiddu
2025-11-28 19:04 ` [RFC PATCH 04/16] crypto: qat - use memcpy_*_sglist() in zlib deflate Giovanni Cabiddu
2025-11-28 19:04 ` [RFC PATCH 05/16] Revert "crypto: testmgr - Remove zlib-deflate" Giovanni Cabiddu
2025-11-28 19:04 ` [RFC PATCH 06/16] crypto: deflate - add support for deflate rfc1950 (zlib) Giovanni Cabiddu
2025-11-28 19:04 ` [RFC PATCH 07/16] crypto: scomp - Add setparam interface Giovanni Cabiddu
2025-11-28 19:04 ` [RFC PATCH 08/16] crypto: acomp " Giovanni Cabiddu
2025-11-28 19:04 ` [RFC PATCH 09/16] crypto: acomp - Add comp_params helpers Giovanni Cabiddu
2025-11-28 19:04 ` [RFC PATCH 10/16] crypto: acomp - add NUMA-aware stream allocation Giovanni Cabiddu
2025-11-28 19:04 ` [RFC PATCH 11/16] crypto: deflate - add support for compression levels Giovanni Cabiddu
2025-11-28 19:05 ` [RFC PATCH 12/16] crypto: zstd " Giovanni Cabiddu
2025-11-28 19:05 ` [RFC PATCH 13/16] crypto: qat - increase number of preallocated sgl descriptors Giovanni Cabiddu
2025-11-28 19:05 ` [RFC PATCH 14/16] crypto: qat - add support for zstd Giovanni Cabiddu
2025-11-28 19:05 ` [RFC PATCH 15/16] crypto: qat - add support for compression levels Giovanni Cabiddu
2025-11-28 19:05 ` [RFC PATCH 16/16] btrfs: add compression hw-accelerated offload Giovanni Cabiddu
2025-11-28 21:55 ` Qu Wenruo
2025-11-28 22:40 ` Giovanni Cabiddu
2025-11-28 23:59 ` Qu Wenruo
2025-11-29 0:23 ` Qu Wenruo
2025-12-01 14:32 ` Giovanni Cabiddu
2025-12-01 15:10 ` Giovanni Cabiddu
2025-12-01 20:57 ` Qu Wenruo
2025-12-01 22:18 ` Giovanni Cabiddu
2025-12-01 23:13 ` Qu Wenruo
2025-12-02 17:09 ` Giovanni Cabiddu
2025-12-02 20:38 ` Qu Wenruo
2025-12-02 22:37 ` Giovanni Cabiddu
2025-12-02 22:59 ` Qu Wenruo
2025-11-29 1:00 ` David Sterba
2025-11-29 1:08 ` David Sterba [this message]
2025-12-02 7:53 ` [RFC PATCH 00/16] btrfs: offload compression to hardware accelerators Christoph Hellwig
2025-12-02 15:46 ` Jani Partanen
2025-12-02 17:19 ` Giovanni Cabiddu
2025-12-03 7:00 ` Christoph Hellwig
2025-12-03 10:15 ` Giovanni Cabiddu
2025-12-04 9:59 ` Christoph Hellwig
2025-12-03 10:47 ` Simon Richter
2025-12-04 10:06 ` Christoph Hellwig
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=20251129010854.GF13846@suse.cz \
--to=dsterba@suse.cz \
--cc=brian.will@intel.com \
--cc=clm@fb.com \
--cc=cyan@meta.com \
--cc=dsterba@suse.com \
--cc=giovanni.cabiddu@intel.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=qat-linux@intel.com \
--cc=senozhatsky@chromium.org \
--cc=terrelln@fb.com \
--cc=weigang.li@intel.com \
--cc=wqu@suse.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