[PATCH 0/2] mm: restore SHRINKER_NONSLAB on THP and zswap shrinkers

From: Qinyun Tan

Date: Thu Sep 03 2026 - 23:42:47 EST


While reviewing the patch "mm/list_lru: don't copy stale shrinker id
from non-memcg-aware shrinkers" (now in mm-unstable), Michal noticed
that the two non-slab memcg-aware shrinkers, the THP deferred split
shrinker and the zswap shrinker, are registered without
SHRINKER_NONSLAB [1].

Without that flag, booting with cgroup.memory=nokmem silently demotes
both shrinkers to non-memcg-aware ones: memcg (limit-induced) reclaim
neither splits partially unmapped THPs nor writes back zswapped pages
of the cgroup under pressure.

Patch 1 restores the flag on the deferred split shrinker; it was lost
when commit fafaeceb89a5 ("mm: switch deferred split shrinker to
list_lru") re-registered the shrinker.

Patch 2 adds the flag to the zswap shrinker, which has never carried
it since its introduction in commit b5ba474f3f51 ("zswap: shrink zswap
pool based on memory pressure").

The series is based on mm-new, on top of the list_lru patch above,
but the changes are independent of it.

[1] https://lore.kernel.org/lkml/697713c4-0857-485b-aba7-c74f37a3c8b4@xxxxxxxxxxxxxxxxx/

Qinyun Tan (2):
mm: thp: restore SHRINKER_NONSLAB on the deferred split shrinker
mm: zswap: mark the zswap shrinker SHRINKER_NONSLAB

mm/huge_memory.c | 3 ++-
mm/zswap.c | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)

--
2.43.7