linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hao Li <hao.li@linux.dev>
To: vbabka@suse.cz, harry.yoo@oracle.com, akpm@linux-foundation.org,
	 cl@gentwo.org, rientjes@google.com, roman.gushchin@linux.dev,
	 linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	hao.li@linux.dev
Cc: akpm@linux-foundation.org, cl@gentwo.org, rientjes@google.com,
	 roman.gushchin@linux.dev, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,  Hao Li <hao.li@linux.dev>
Subject: [PATCH] slub: let need_slab_obj_exts() return false if SLAB_NO_OBJ_EXT is set
Date: Thu, 5 Feb 2026 20:07:23 +0800	[thread overview]
Message-ID: <20260205120709.425719-1-hao.li@linux.dev> (raw)

SLAB_NO_OBJ_EXT is set for boot caches, but need_slab_obj_exts() doesn't
check this flag. We should return false unconditionally when
SLAB_NO_OBJ_EXT is set.

Signed-off-by: Hao Li <hao.li@linux.dev>
---
 mm/slub.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/slub.c b/mm/slub.c
index 865047eaf02b..3b1402e1c39d 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -901,6 +901,9 @@ static inline unsigned long get_orig_size(struct kmem_cache *s, void *object)
  */
 static inline bool need_slab_obj_exts(struct kmem_cache *s)
 {
+	if (s->flags & SLAB_NO_OBJ_EXT)
+		return false;
+
 	if (memcg_kmem_online() && (s->flags & SLAB_ACCOUNT))
 		return true;
 
-- 
2.50.1



             reply	other threads:[~2026-02-05 12:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-05 12:07 Hao Li [this message]
2026-02-06  0:53 ` Harry Yoo
2026-02-06  9:40   ` Vlastimil Babka
2026-02-06 10:01     ` Harry Yoo
2026-02-06 10:03       ` Vlastimil Babka
2026-02-06 10:21         ` Harry Yoo
2026-02-06 11:35           ` Hao Li

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=20260205120709.425719-1-hao.li@linux.dev \
    --to=hao.li@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=harry.yoo@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=vbabka@suse.cz \
    /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