From: Harry Yoo <harry.yoo@oracle.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Christoph Lameter <cl@gentwo.org>,
David Rientjes <rientjes@google.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
Muchun Song <muchun.song@linux.dev>,
Shakeel Butt <shakeel.butt@linux.dev>,
Michal Hocko <mhocko@kernel.org>,
Yeoreum Yun <yeoreum.yun@arm.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Suren Baghdasaryan <surenb@google.com>, Hai Li <hao.li@linux.dev>,
linux-mm@kvack.org
Subject: Re: [PATCH V1 1/2] mm/slab: factor out slab_args_unmergeable()
Date: Wed, 28 Jan 2026 01:42:31 +0900 [thread overview]
Message-ID: <aXjq99QW3EzOuyYP@hyeyoo> (raw)
In-Reply-To: <f6b85926-04b6-4c02-a6f2-1e141c9426b0@suse.cz>
On Tue, Jan 27, 2026 at 05:35:50PM +0100, Vlastimil Babka wrote:
> On 1/27/26 11:31, Harry Yoo wrote:
> > slab_mergeable() determines whether a slab cache can be merged, but it
> > should not be used when the cache is not fully created yet.
> >
> > Extract the pre-cache-creation mergeability checks into
> > slab_args_unmergeable(), which evaluates kmem_cache_args, slab flags,
> > and slab_nomerge to determine if a cache will be mergeable before it is
> > created.
> >
> > Signed-off-by: Harry Yoo <harry.yoo@oracle.com>
> > ---
> > mm/slab_common.c | 28 ++++++++++++++++++----------
> > 1 file changed, 18 insertions(+), 10 deletions(-)
> >
> > diff --git a/mm/slab_common.c b/mm/slab_common.c
> > index 2e80d323f550..904414c3ebb8 100644
> > --- a/mm/slab_common.c
> > +++ b/mm/slab_common.c
> > @@ -174,24 +174,32 @@ int slab_unmergeable(struct kmem_cache *s)
> > return 0;
> > }
> >
> > -static struct kmem_cache *find_mergeable(unsigned int size, slab_flags_t flags,
> > - const char *name, struct kmem_cache_args *args)
> > +static bool slab_args_unmergeable(struct kmem_cache_args *args,
> > + slab_flags_t flags)
> > {
> > - struct kmem_cache *s;
> > - unsigned int align;
> > -
> > if (slab_nomerge)
> > - return NULL;
> > + return true;
>
> I think this still logically belongs to find_mergeable() and not here, so
> moved there. Agreed?
But then patch 2/2 should be modified to check slab_nomerge then?
And even slab_unmergeable() does slab_nomerge check, so perhaps it's
more consistent to do it in slab_args_unmergeable().
--
Cheers,
Harry / Hyeonggon
next prev parent reply other threads:[~2026-01-27 16:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-27 10:31 [PATCH V1 0/2] Only allow SLAB_OBJ_EXT_IN_OBJ for unmergeable caches Harry Yoo
2026-01-27 10:31 ` [PATCH V1 1/2] mm/slab: factor out slab_args_unmergeable() Harry Yoo
2026-01-27 16:35 ` Vlastimil Babka
2026-01-27 16:42 ` Harry Yoo [this message]
2026-01-27 16:49 ` Vlastimil Babka
2026-01-27 10:31 ` [PATCH V1 2/2] mm/slab: only allow SLAB_OBJ_EXT_IN_OBJ for unmergeable caches Harry Yoo
2026-02-03 11:56 ` Hao Li
2026-02-03 12:32 ` Harry Yoo
2026-02-04 0:45 ` Hao Li
2026-02-05 5:13 ` Harry Yoo
2026-02-05 6:27 ` Hao Li
2026-01-27 17:06 ` [PATCH V1 0/2] Only " Vlastimil Babka
2026-01-27 18:21 ` Johannes Weiner
2026-01-28 3:09 ` To enable, or not to enable slab merging? That is the question (was: Re: [PATCH V1 0/2] Only allow SLAB_OBJ_EXT_IN_OBJ for unmergeable caches) Harry Yoo
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=aXjq99QW3EzOuyYP@hyeyoo \
--to=harry.yoo@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=cl@gentwo.org \
--cc=hannes@cmpxchg.org \
--cc=hao.li@linux.dev \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=yeoreum.yun@arm.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