Re: [RFC PATCH 6/6] btrfs: zlib: add support for zlib-deflate through acomp

Cabiddu, Giovanni
2025-05-06T15:38:45Z

Hi David,

I've resumed work on this, now that I have all necessary dependencies to
offload ZSTD to QAT.

On Mon, Apr 29, 2024 at 04:41:29PM +0100, David Sterba wrote:
...
> I'd skip the style and implementation details for now. The absence of
> compression level support seems like the biggest problem, also in
> combination with uncondtional use of the acomp interface.
Regarding compression levels, Herbert suggested a new interface that
would effectively address this concern [1].

> We'd have to enhance the compression format specifier to make it
> configurable in the sense: if accelerator is available use it, otherwise
> do CPU and synchronous compression.
For usability, wouldn't it be better to have a transparent solution? If
an accelerator is present, use it, rather than having a configuration
knob.

In any case, I would like to understand the best way forward here. I
would like to offload both zlib_deflate and ZSTD. However, I wouldn't
like to replicate the logic that calls the acomp APIs in both
fs/btrfs/zlib.c and fs/btrfs/zstd.c.

Thanks,

--
Giovanni

[1] https://lore.kernel.org/all/cover.1716202860.git.herbert@gondor.apana.org.au/