Re: [PATCH v13 22/22] mm: zswap: Batched zswap_compress() with compress batching of large folios.
From: Yosry Ahmed
Date: Wed Nov 26 2025 - 01:35:09 EST
On Wed, Nov 26, 2025 at 01:46:57PM +0800, Herbert Xu wrote:
> On Fri, Nov 14, 2025 at 03:37:53PM +0000, Yosry Ahmed wrote:
> >
> > Thanks for the clarification. I understand that the error code has
> > different sources for SW and HW compressors, but I do not like using
> > errp as an indirection. It makes the code unclear. I would rather we
> > explicitly check err for SW compressors and dlen for HW compressors.
> >
> > That being said, I thought what Herbert suggested was that the same API
> > is used for both SW and HW compressors. IOW, either way we submit a
> > batch of pages (8 pages for SW compressors), and then the crypto API
> > would either give the entire batch to the compressor if it supports
> > batching, or loop over them internally and hand them page-by-page to
> > the compressor.
> >
> > This would simplify usage as we do not have to handle the differences in
> > zswap.
> >
> > If that is not doable, at the very least the API should be consistent.
> > Right now the error code and length are propagated differently to the
> > caller based on whether or not the compressor support batching.
>
> Yes we should only have one code path in zswap, regardless of whether
> batching is used or not.
>
> The degenerate case of a batch with a single page should be handled
> by the Crypto API.
>
> So I will change crypto_acomp to take care of this case.
Nice :)
>
> Cheers,
> --
> Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt