Re: [PATCH v4 1/4] fs: fix missed removal of super_fs_objects_eligible()
From: Qi Zheng
Date: Sun Aug 30 2026 - 22:28:40 EST
Hi Andrew,
On 8/30/26 7:23 AM, Andrew Morton wrote:
On Sat, 29 Aug 2026 09:49:44 +0800 Qi Zheng <qi.zheng@xxxxxxxxx> wrote:
Hi Andrew,
On 8/29/26 2:41 AM, Andrew Morton wrote:
On Mon, 17 Aug 2026 17:03:25 +0800 Qi Zheng <qi.zheng@xxxxxxxxx> wrote:
From: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
Commit 0ef8faff490be ("fs: push nr_cached_objects memcg gating into
individual filesystems") forgot to drop the super_fs_objects_eligible(),
just fix it.
Oh. Why? Please can we have a description of what's wrong with the
current code?
As I replied in another thread [1], this fix and commit 0ef8faff490be
together make up the complete patch originally sent by Usama [2], so
they should be squashed together.
0ef8faff490be is upstream so they can't be squashed!
So sad.
Without this fix, all memcg-aware
nr_cached_objects() will be skipped during memcg-level shrinking.
Besides the newly added memcg-aware shmem huge shrinker, XFS will also
run into issues.
OK, please add this info to this patch's changelog. Please also decide
whether a cc:stable should be added and if so, ensure the changelog
makes clear why we're recommending a backport.
As part of this, let's expand on "XFS will also run into issues".
How about this instead:
---
Commit 0ef8faff490be ("fs: push nr_cached_objects memcg gating into
individual filesystems") was meant to drop the blanket memcg gate in
fs/super.c and let each ->nr_cached_objects() implementation decide
for itself whether it is meaningful in per-memcg reclaim. However,
when that patch was applied the removal of super_fs_objects_eligible()
and its two call sites in super_cache_scan() / super_cache_count() was
lost, so the helper is still gating every ->nr_cached_objects() hook
and 0ef8faff490be is effectively a no-op.
Consequences of the leftover gate:
- XFS's inode-reclaim hook, which is intentionally driven from
per-memcg contexts to free memcg-charged slab, is still
short-circuited in fs/super.c — exactly the regression from
commit 0baad6f9b997 ("fs/super: skip non-memcg-aware
nr_cached_objects in memcg slab shrink") that 0ef8faff490be was
written to undo. Memcg-charged XFS inode slab therefore keeps
piling up under per-memcg pressure until global reclaim kicks in.
- Any future ->nr_cached_objects()/->free_cached_objects() that
grows memcg awareness is likewise blocked before it can run, so
filesystems cannot opt in to per-memcg reclaim on their own —
defeating the whole point of pushing the gating decision down
into the callbacks.
Drop the leftover helper and its call sites so the intent of
0ef8faff490be actually takes effect.
Fixes: 0ef8faff490be ("fs: push nr_cached_objects memcg gating into individual filesystems")
Cc: stable@xxxxxxxxxxxxxxx
---
Can you fix up the commit message directly on your end? Let me know if
you prefer me to spin a v5 instead.
Thank,
Qi
Thanks.