Re: [PATCH v2 2/4] mm: list_lru: keep per-memcg lists with nokmem for NONSLAB-backed lrus

From: Johannes Weiner

Date: Wed Sep 09 2026 - 15:13:07 EST


On Mon, Sep 07, 2026 at 07:01:09PM +0800, Qinyun Tan 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>