Re: [PATCH] mm: zswap: Use SG list decompression APIs from zsmalloc
From: Sergey Senozhatsky
Date: Tue Jan 20 2026 - 22:51:03 EST
On (26/01/21 01:36), Yosry Ahmed wrote:
> Use the new zs_obj_read_sg_*() APIs in zswap_decompress(), instead of
> zs_obj_read_*() APIs returning a linear address. The SG list is passed
> directly to the crypto API, simplifying the logic and dropping the
> workaround that copies highmem addresses to a buffer. The crypto API
> should internally linearize the SG list if needed.
>
> This avoids the memcpy() in zsmalloc for objects spanning multiple
> pages, although an equivalent operation will be done internally by
> acomp/scomp. However, in the future compression algorithms could support
> handling discontiguous SG lists, completely eliminating the copying for
> spanning objects.
LGTM.
Once the API lands I think we'll be quite interested in discontiguous
SG lists support in lzo-rle/lzo and lz4 (most commonly used primary
S/W compressors in zram).