[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aWocoGf9kxVCgXmw@hyeyoo>
Date: Fri, 16 Jan 2026 20:10:24 +0900
From: Harry Yoo <harry.yoo@...cle.com>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Suren Baghdasaryan <surenb@...gle.com>, Petr Tesarik <ptesarik@...e.com>,
Christoph Lameter <cl@...two.org>,
David Rientjes <rientjes@...gle.com>,
Roman Gushchin <roman.gushchin@...ux.dev>, Hao Li <hao.li@...ux.dev>,
Andrew Morton <akpm@...ux-foundation.org>,
Uladzislau Rezki <urezki@...il.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Alexei Starovoitov <ast@...nel.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, linux-rt-devel@...ts.linux.dev,
bpf@...r.kernel.org, kasan-dev@...glegroups.com
Subject: Re: [PATCH RFC v2 03/20] mm/slab: make caches with sheaves mergeable
On Fri, Jan 16, 2026 at 12:01:23PM +0100, Vlastimil Babka wrote:
> On 1/16/26 09:46, Harry Yoo wrote:
> > On Fri, Jan 16, 2026 at 08:24:02AM +0100, Vlastimil Babka wrote:
> >> On 1/16/26 01:22, Suren Baghdasaryan wrote:
> >> > On Mon, Jan 12, 2026 at 3:17 PM Vlastimil Babka <vbabka@...e.cz> wrote:
> >> >> @@ -337,6 +331,13 @@ struct kmem_cache *__kmem_cache_create_args(const char *name,
> >> >> flags &= ~SLAB_DEBUG_FLAGS;
> >> >> #endif
> >> >>
> >> >> + /*
> >> >> + * Caches with specific capacity are special enough. It's simpler to
> >> >> + * make them unmergeable.
> >> >> + */
> >> >> + if (args->sheaf_capacity)
> >> >> + flags |= SLAB_NO_MERGE;
> >> >
> >> > So, this is very subtle and maybe not that important but the comment
> >> > for kmem_cache_args.sheaf_capacity claims "When slub_debug is enabled
> >> > for the cache, the sheaf_capacity argument is ignored.". With this
> >> > change this argument is not completely ignored anymore... It sets
> >> > SLAB_NO_MERGE even if slub_debug is enabled, doesn't it?
> >>
> >> True, but the various debug flags set by slub_debug also prevent merging so
> >> it doesn't change the outcome.
> >
> > nit: except for slub_debug=F (SLAB_CONSISTENCY_CHECKS), since it doesn't
> > prevent merging (it's in SLAB_DEBUG_FLAGS but not in SLAB_NEVER_MERGE).
>
> Hm right. But I think that's wrong then and it should be there.
> SLAB_CONSISTENCY_CHECKS is enough to stop using the fastpaths (both
> before/after sheaves) so it should be a reason not to merge.
Agreed!
--
Cheers,
Harry / Hyeonggon
Powered by blists - more mailing lists