[PATCH v3 0/2] mm/zswap: Fixes and improves the zswap shrink

From: Hao Jia

Date: Wed Jul 29 2026 - 05:08:03 EST


From: Hao Jia <jiahao1@xxxxxxxxxxx>

This series fixes and improves the zswap global shrinker (shrink_worker()):
Patch 1: Fix missing global shrinker when memory cgroup is disabled.
Patch 2: Extend shrink_memcg() to support batch writeback and thereby improving
the writeback efficiency in the shrink_worker() and zswap_store() paths.

v2->v3:
- Added user impact to the commit 1 message.
- Updated writeback batch size to SWAP_CLUSTER_MAX to avoid introducing new
magic macros. And enabled batched shrinking in the zswap_store() path as well.
- Re-benchmarked performance data with the updated patch.
v1->v2:
- Add a reschedule check to the -ENOENT return path in shrink_memcg() to
handle the theoretical issue of prolonged heavy concurrent zswap stores.
- Remove the shrink_memcg() return value changes part, and include a more
detailed test report in the commit message.


[v2] https://lore.kernel.org/all/20260717085151.22822-1-jiahao.kernel@xxxxxxxxx
[v1] https://lore.kernel.org/all/20260714081510.16895-1-jiahao.kernel@xxxxxxxxx

Hao Jia (2):
mm/zswap: Fix global shrinker when memory cgroup is disabled
mm/zswap: Support batch writeback in shrink_memcg()

mm/zswap.c | 58 ++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 45 insertions(+), 13 deletions(-)

--
2.34.1