v2
2026-10-30
zswap 批量压缩存储 · v2
为 zswap_store() 大 folio 引入按 8 页批次的压缩存储,并配套 crypto_acomp 批处理框架。
原始补丁链接
子 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: 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
8/8
mm: zswap: Refactor and optimize zswap_store_pages() batch operations.
This 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_compress() zswap_tree_stores