Re: [RFC PATCH 2/2] zsmalloc: chain-length configuration should consider other metrics

From: Herbert Xu

Date: Wed Jan 07 2026 - 00:43:05 EST


On Wed, Jan 07, 2026 at 05:39:50AM +0000, Yosry Ahmed wrote:
>
> In this case I think we can just make zsmalloc return an SG list and use it in both zswap and zram. We will fallback to the memcpy() in scomp instead of the memcpy() in zsmalloc, and we'll drop the memcpy() logic in zswap as a bonus.
>
> Will this for acomp though?

Yes it works for acomp too since scomp sits underneath acomp.

> Yeah the effort to add native support to compressors can be done separately. For zswap, I think the most common compressors are actually zstd and LZ4.

OK once you start using it then I could add the native SG support
to LZO and it should become a little bit faster (and eliminate the
need for the scomp bounce page).

Cheers,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt