Re: [PATCH v2 0/4] mm/zswap: Implement per-cgroup proactive writeback

From: Hao Jia

Date: Tue May 26 2026 - 07:56:57 EST




On 2026/5/26 03:24, Andrew Morton wrote:
On Mon, 25 May 2026 20:22:38 +0800 Hao Jia <jiahao.kernel@xxxxxxxxx> wrote:

Zswap currently writes back pages to backing swap reactively, triggered
either by the shrinker or by the pool reaching its size limit. Although
proactive memory reclaim can automatically write back a portion of zswap
pages via the shrinker, it cannot explicitly control the amount of
writeback for a specific memory cgroup. Moreover, proactive memory reclaim
may not always be triggered during a steady state.

In certain scenarios, it is desirable to trigger writeback in advance to
free up memory. For example, users may want to prepare for an upcoming
memory-intensive workload by flushing cold memory to the backing storage
when the system is relatively idle.

This patch series introduces a "zswap_writeback_only" key to memory.reclaim
cgroup interface, allowing users to proactively write back cold compressed
pages from zswap to the backing swap device. When specified, this key
bypasses standard memory reclaim and exclusively performs proactive zswap
writeback up to the requested budget. If omitted, the default reclaim
behavior remains unchanged.

Thanks. AI review found a few things to complain about, one of them
described as "preexisting".


Thanks Andrew. I have replied to the AI's review comments in a separate email and posted v3.
https://lore.kernel.org/all/20260526114601.67041-1-jiahao.kernel@xxxxxxxxx

Thanks,
Hao