v1 2026-10-20

zswap_store 压缩批处理 · v1

zswap_store 大 folio 批量压缩:按 8 页 ZSWAP_MAX_BATCH_SIZE 分批,利用 bulk 分配与缓存局部性。

原始补丁链接

子 Patch(8)

1/8
crypto: acomp - Define a unit_size in struct acomp_req to enable batching. mm: zswap: Set the unit size for zswap to PAGE_SIZE.
We add a new @unit_size data member to struct acomp_req along with a helper function acomp_request_set_unit_size() for kernel modules to set the unit size to use while breaking down the request’s src/
2/8
crypto: acomp - Add bit to indicate segmentation support.
This patch adds segmentation support for compression. Add a bit to the crypto_alg flags to indicate support for segmentation. Also add a helper for acomp to test whether a given tfm supports segmenta
3/8
crypto: acomp - Add trivial segmentation wrapper.
This patch provides a wrapper for existing algorithms so that they can accept a single segment while returning the compressed length or error through the dst SG list length. This trivial segmentation
4/8
crypto: acomp - Add API to get a compression algorithm's batch-size.
This commit adds a @batch_size data member to struct acomp_alg. An acomp_alg compression algorithm that supports batching of compressions and decompressions must provide a @batch_size greater than 1,
5/8
mm: zswap: Store the folio's node id in the zswap_entry.
When storing a folio in zswap, save the folio’s node id in the zswap entry instead of relying on the zswap_entry being allocated on the same node. This enables optimizations such as batch allocation o
6/8
mm: zswap: Store large folios in batches.
Use batching when storing large folios in zswap. If the underlying compressor supports batching (e.g. hardware parallel compression), allocate multiple compression buffers, otherwise allocate one. The
7/8
mm: zswap: Optimally place members of struct zswap_pool, struct zswap_entry.
Place and align the members of struct zswap_pool and struct zswap_entry such that members used together in compress/decompress hot paths are able to share the same cacheline. Minimize holes within the
8/8
mm: zswap: Batched zswap_compress() for storing large folios in batches.
A new batching implementation of zswap_compress() is provided for compressors that do and do not support batching. This eliminates code duplication and facilitates code maintainability with the introd