v4
2026-10-26
nokmem 下恢复按 memcg 回收 · v4
nokmem 下 THP 延迟分裂与 zswap shrinker 缺 SHRINKER_NONSLAB,系列恢复其 per-memcg 回收并整理 list_lru 索引。
原始补丁链接
子 Patch(5)
1/5
mm: list_lru: pass the memcg index directly to the walker
list_lru_walk_node() looks up the memcg for each xarray index, only to have __list_lru_walk_one() translate that memcg back to an index to find the sublist. The walker has no other use for the memcg.
2/5
mm: memcontrol: drop kmemcg_id and use mem_cgroup_id() for list_lru indexing
kmemcg_id is a copy of the private memcg ID and serves no purpose other than indexing the per-memcg list_lru xarray. It is assigned when kmem accounting goes online, which never happens with cgroup.m
3/5
mm: list_lru: keep per-memcg lists with nokmem for NONSLAB-backed lrus
With cgroup.memory=nokmem, __list_lru_init() collapses every list_lru into per-node lists. That is fine for slab objects, which are not charged per memcg without kmem accounting. But a lru backed by
4/5
mm: thp: restore SHRINKER_NONSLAB on the deferred split shrinker
On a system booted with cgroup.memory=nokmem, the deferred split shrinker is demoted to a non-memcg-aware one. As a result, partially unmapped THPs are only split under global reclaim; memcg (limit-i
5/5
mm: zswap: mark the zswap shrinker SHRINKER_NONSLAB
With kmem accounting disabled (cgroup.memory=nokmem), memcg reclaim never invokes the zswap shrinker: a cgroup under memory pressure does not write back its own zswapped pages to make room; they are o