From: Haifeng Xu <haifeng.xu@shopee.com>
To: akpm@linux-foundation.org, david@fromorbit.com,
roman.gushchin@linux.dev, hannes@cmpxchg.org, mhocko@kernel.org,
shakeel.butt@linux.dev
Cc: zhengqi.arch@bytedance.com, muchun.song@linux.dev,
usama.arif@linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Haifeng Xu <haifeng.xu@shopee.com>
Subject: [PATCH V3 4/4] mm: shrinker: remove unnecessary check in shrink_slab_memcg()
Date: Wed, 11 Mar 2026 11:02:35 +0800 [thread overview]
Message-ID: <20260311030235.240953-5-haifeng.xu@shopee.com> (raw)
In-Reply-To: <20260311030235.240953-1-haifeng.xu@shopee.com>
If memcg_kmem_online() is false, only non-slab shrinkers are recorded
in the map, so remove the check.
Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
---
mm/shrinker.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/mm/shrinker.c b/mm/shrinker.c
index 3137518bc746..98307a9bd00e 100644
--- a/mm/shrinker.c
+++ b/mm/shrinker.c
@@ -639,11 +639,6 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
}
rcu_read_unlock();
- /* Call non-slab shrinkers even though kmem is disabled */
- if (!memcg_kmem_online() &&
- !(shrinker->flags & SHRINKER_NONSLAB))
- continue;
-
ret = do_shrink_slab(&sc, shrinker, priority);
if (ret == SHRINK_EMPTY) {
clear_bit(offset, unit->map);
--
2.43.0
prev parent reply other threads:[~2026-03-11 3:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-11 3:02 [PATCH V3 0/4] record non-slab shrinkers for non-root memcgs when kmem is disabled Haifeng Xu
2026-03-11 3:02 ` [PATCH V3 1/4] mm: shrinker: add one more parameter in shrinker_id() Haifeng Xu
2026-03-11 3:02 ` [PATCH V3 2/4] mm: shrinker: move shrinker_id() code block below memcg_kmem_online() Haifeng Xu
2026-03-11 3:02 ` [PATCH V3 3/4] mm: shrinker: optimize the allocation of shrinker_info when setting cgroup_memory_nokmem Haifeng Xu
2026-03-11 21:19 ` Andrew Morton
2026-03-12 4:16 ` Haifeng Xu
2026-03-11 3:02 ` Haifeng Xu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260311030235.240953-5-haifeng.xu@shopee.com \
--to=haifeng.xu@shopee.com \
--cc=akpm@linux-foundation.org \
--cc=david@fromorbit.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=usama.arif@linux.dev \
--cc=zhengqi.arch@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox