Re: [PATCH v6 02/16] crypto: acomp - Define new interfaces for compress/decompress batching.
From: Herbert Xu
Date: Sun Feb 16 2025 - 00:11:12 EST
On Wed, Feb 05, 2025 at 11:20:48PM -0800, Kanchana P Sridhar wrote:
> This commit adds get_batch_size(), batch_compress() and batch_decompress()
> interfaces to:
>
> struct acomp_alg
> struct crypto_acomp
>
> A crypto_acomp compression algorithm that supports batching of compressions
> and decompressions must provide implementations for these API.
>
> A new helper function acomp_has_async_batching() can be invoked to query if
> a crypto_acomp has registered these batching interfaces.
>
> A higher level module like zswap can call acomp_has_async_batching() to
> detect if the compressor supports batching, and if so, it can call
> the new crypto_acomp_batch_size() to detect the maximum batch-size
> supported by the compressor. Based on this, zswap can use the minimum of
> any zswap-specific upper limits for batch-size and the compressor's max
> batch-size, to allocate batching resources.
>
> This allows the iaa_crypto Intel IAA driver to register implementations for
> the get_batch_size(), batch_compress() and batch_decompress() acomp_alg
> interfaces, that can subsequently be invoked from the kernel zswap/zram
> modules to compress/decompress pages in parallel in the IAA hardware
> accelerator to improve swapout/swapin performance through these newly added
> corresponding crypto_acomp API:
>
> crypto_acomp_batch_size()
> crypto_acomp_batch_compress()
> crypto_acomp_batch_decompress()
>
> Signed-off-by: Kanchana P Sridhar <kanchana.p.sridhar@xxxxxxxxx>
> ---
> crypto/acompress.c | 3 +
> include/crypto/acompress.h | 111 ++++++++++++++++++++++++++++
> include/crypto/internal/acompress.h | 19 +++++
> 3 files changed, 133 insertions(+)
Please get rid of these batch interfaces. The whole point of
request chaining is to remove the distinction between batching
and normal requests. IOW, if a request is chained then it is
automatically processed as a batch. If it's a singleton then
normal processing will occur.
Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt