From: Hao Li <hao.li@linux.dev>
To: Harry Yoo <harry.yoo@oracle.com>
Cc: Vlastimil Babka <vbabka@suse.cz>,
akpm@linux-foundation.org, cl@gentwo.org, rientjes@google.com,
roman.gushchin@linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] slub: let need_slab_obj_exts() return false if SLAB_NO_OBJ_EXT is set
Date: Fri, 6 Feb 2026 19:35:07 +0800 [thread overview]
Message-ID: <koypivw3zonvakx3k2ji5ti4oy5yv6t2yaretkbh6dd2f5h5uh@gjbuxu7ryph4> (raw)
In-Reply-To: <aYXAqQFGfru8aC6M@hyeyoo>
On Fri, Feb 06, 2026 at 07:21:29PM +0900, Harry Yoo wrote:
> On Fri, Feb 06, 2026 at 11:03:08AM +0100, Vlastimil Babka wrote:
> > On 2/6/26 11:01, Harry Yoo wrote:
> > > On Fri, Feb 06, 2026 at 10:40:54AM +0100, Vlastimil Babka wrote:
> > >> On 2/6/26 01:53, Harry Yoo wrote:
> > >> > On Thu, Feb 05, 2026 at 08:07:23PM +0800, Hao Li wrote:
> > >> >> 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>
> > >> >> ---
> > >> >
> > >> > Looks reasonable to me,
> > >> > Acked-by: Harry Yoo <harry.yoo@oracle.com>
> > >>
> > >> Thanks, added to slab/for-7.0/obj_metadata
> > >> I think it doesn't change anything at the moment?
> > >
> > > ...unless you enable memory allocation profiling :)
> >
> > If I do, would kmem_cache or kmem_cache_node caches gotten obj_exts in
> > leftover space?
>
> /me builds and tests a new kernel with mem profiling always enabled...
>
> Yes, but only if merging is disabled.
>
> If you disable slab merging with `slab_nomerge`, kmem_cache gets
> obj_exts from SLAB_OBJ_EXTS_IN_OBJ.
>
> When I enable debug feature slab_debug=P (and thus change s->size),
> kmem_cache_node gets obj_exts from SLAB_OBJ_EXTS_IN_OBJ.
Thanks for testing, this matches what I've seen too.
Besides, even if the two boot caches, kmem_cache and kmem_cache_node, go through
the SLAB_OBJ_EXT_IN_OBJ path, it seems it wouldn't cause real trouble. We'd just
end up doing some unnecessary memset. So, as Vlastimil said, this patch is
mostly about doing the right thing.
--
Thanks,
Hao
>
> --
> Cheers,
> Harry / Hyeonggon
prev parent reply other threads:[~2026-02-06 11:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-05 12:07 Hao Li
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 [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=koypivw3zonvakx3k2ji5ti4oy5yv6t2yaretkbh6dd2f5h5uh@gjbuxu7ryph4 \
--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