v3 2026-11-06

zswap 批量压缩存储框架 · v3

为 zswap_store 大 folio 引入 4 页批次压缩存储,以批量 API 减少锁开销。

原始补丁链接

子 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. A new constant, ZSWAP_MAX_BATCH_SIZE is defined as 4U to support processing batches of up to 4 pages at a time while storing large folios. This commit
7/8
mm: zswap: Refactor and optimize zswap_store_pages() batch operations.
The various stages of zswap_store_pages() are broken down into routines that work on a batch of data when a large folio is being processed: zswap_init_entries() zswap_tree_stores() The struct zswa
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