Re: [PATCH v5 2/4] mm: list_lru: keep per-memcg lists with nokmem for NONSLAB-backed lrus
From: Muchun Song
Date: Mon Nov 23 2026 - 07:24:28 EST
> On Nov 23, 2026, at 18:53, Qinyun Tan <qinyuntan@xxxxxxxxxxxxxxxxx> wrote:
>
> 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 a
> SHRINKER_NONSLAB shrinker, e.g. the THP deferred split queue or the
> zswap entries, holds user memory, which is charged regardless of
> nokmem. Collapsing such an lru loses the per-memcg view of its
> objects. Reclaim can no longer target just the cgroup under pressure.
>
> Keep such lrus memcg aware under nokmem when their backing shrinker is
> registered SHRINKER_NONSLAB.
>
> This leaves the savings of nokmem intact: slab-backed lrus (e.g. the
> superblock dentry/inode lrus) still fall back to the per-node lists,
> and the per-memcg lists are allocated only when a memcg actually holds
> such objects.
>
> Fixes: fafaeceb89a5 ("mm: switch deferred split shrinker to list_lru")
> Signed-off-by: Qinyun Tan <qinyuntan@xxxxxxxxxxxxxxxxx>
> Reviewed-by: Johannes Weiner <hannes@xxxxxxxxxxx>
Acked-by: Muchun Song (ByteDance) <muchun.song@xxxxxxxxx>