Re: [RFC PATCH 2/2] zsmalloc: chain-length configuration should consider other metrics
From: Herbert Xu
Date: Thu Jan 08 2026 - 05:00:07 EST
On Thu, Jan 08, 2026 at 08:01:20AM +0000, Yosry Ahmed wrote:
>
> IIUC based on Herbert's previous response, crypto and scomp already
> support passing in a discontiguous SG-list. So for zswap, if zsmalloc
> returns an SG-list, it will just be passed as-is to the crypto API.
>
> If zram can also use the SG-list, then we can completely drop the
> memcpy() logic from zsmalloc.
>
> Herbert, please correct me if I am wrong.
You're correct. The SG support has always been there. You can
use that today and scomp will perform the memcpy for you if and
only if it's necessary.
The algorithm-specific SG support would simply be a performance
enhancement that eliminates the memcpy entirely for whichever
algorithm that we choose to implement it for.
Cheers,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt