From: Harry Yoo <harry@kernel.org>
To: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>,
Suren Baghdasaryan <surenb@google.com>
Cc: Shakeel Butt <shakeel.butt@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Hao Li <hao.li@linux.dev>, Christoph Lameter <cl@gentwo.org>,
David Rientjes <rientjes@google.com>,
Usama Arif <usama.arif@linux.dev>,
Meta kernel team <kernel-team@meta.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Danielle Costantino <dcostantino@meta.com>,
Kees Cook <kees@kernel.org>
Subject: Re: [PATCH] mm/slub: serve slabobj_ext array from a strictly larger kmalloc cache
Date: Tue, 30 Jun 2026 16:03:30 +0900 [thread overview]
Message-ID: <5ebd3c4a-5c06-43b4-ab0a-7a8f0396c84c@kernel.org> (raw)
In-Reply-To: <c5c4208d-a6f0-413e-bad9-49be12f12d55@kernel.org>
On 6/30/26 3:12 PM, Vlastimil Babka (SUSE) wrote:
> On 6/30/26 07:29, Suren Baghdasaryan wrote:
>> On Mon, Jun 29, 2026 at 9:42 PM Harry Yoo <harry@kernel.org> wrote:
>>>
>>>
>>>
>>> On 6/30/26 1:39 PM, Suren Baghdasaryan wrote:
>>>> On Mon, Jun 29, 2026 at 9:38 PM Suren Baghdasaryan <surenb@google.com> wrote:
>>>>>
>>>
>>> Ah, here I meant backporting either the kmalloc_flags()+KMALLOC_TYPE or
>>> SLAB_BUCKETS approach.
>>>
>>>>> Yes, it's worth backporting, so we can merge Shakeel's change as is
>>>
>>> Right.
>>>
>>>>> and then once Vlastimil's patch is merged we can implement the new
>>>
>>> Vlastimil's patch has already landed mainline, by the way :)
>>
>> Nice! I suggest posting Shakeel's patch CC'ing stable for backports
>> and then following up with the fix using KMALLOC_TYPE. Vlastimil,
>> WDYT?
>
> Sounded like a plan, but then I realized I misunderstood the amount of the
> wastage. E.g. on my system kmalloc-8k with 4 objects per slab would have
> obj_ext size of 64, but now it's 16k? That's ridiculous.
Right.
...which is why I was assuming either the KMALLOC_TYPE or SLAB_BUCKETS
approach would be backported as a follow-up. Err, should have
communicated clearly, apologies.
> I think it will> even self-amplify to some extent? kmalloc-8 would
have 512 objects per slab,
> so its obj_ext is 8k. It will not recursively create an obj_ext for the> obj_ext, but other 8k allocation in the same kmalloc-8k slab could then
> trigger it, right?
True, assuming that by 'self-amplifying' you meant this patch creates
more kmalloc-8k objects, and also now kmalloc-8k wastes memory memory.
> We could say it's for a debugging feature, but also it's running in
> production fleets (and Android?), so probably not that easy to dismiss.
I think a key factor is when it's enabled in production.
kconfigs says Android selects MEM_ALLOC_PROFILING, but not
MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT.
I assumed that turning it on by default in the entire fleet
would be bit hard to justify... (please correct me,
if it's not the case)
> Sudden memory increase in a LTS due to this backport doesn't sound nice to me.
--
Cheers,
Harry / Hyeonggon
next prev parent reply other threads:[~2026-06-30 7:03 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-25 23:00 [PATCH] mm/slub: serve slabobj_ext array from a strictly larger kmalloc cache Shakeel Butt
2026-06-26 4:22 ` Harry Yoo
2026-06-26 16:49 ` Shakeel Butt
2026-06-26 17:11 ` Vlastimil Babka (SUSE)
2026-06-28 2:58 ` Shakeel Butt
2026-06-28 3:23 ` Shakeel Butt
2026-06-28 7:47 ` Vlastimil Babka (SUSE)
2026-06-28 9:22 ` Harry Yoo
2026-06-28 23:37 ` Suren Baghdasaryan
2026-06-29 3:57 ` Harry Yoo
2026-06-29 4:28 ` Suren Baghdasaryan
2026-06-29 19:52 ` Shakeel Butt
2026-06-30 2:03 ` Harry Yoo
2026-06-30 2:30 ` Harry Yoo
2026-06-30 4:38 ` Suren Baghdasaryan
2026-06-30 4:39 ` Suren Baghdasaryan
2026-06-30 4:42 ` Harry Yoo
2026-06-30 5:29 ` Suren Baghdasaryan
2026-06-30 6:12 ` Vlastimil Babka (SUSE)
2026-06-30 7:03 ` Harry Yoo [this message]
2026-06-30 14:35 ` Shakeel Butt
2026-06-30 14:52 ` Suren Baghdasaryan
2026-06-30 15:27 ` Harry Yoo
2026-06-30 23:55 ` Suren Baghdasaryan
2026-07-01 4:30 ` Harry Yoo
2026-07-01 4:53 ` Harry Yoo
2026-07-01 7:42 ` Harry Yoo
2026-07-01 8:43 ` Harry Yoo
2026-07-01 10:31 ` Harry Yoo
2026-07-01 11:37 ` Suren Baghdasaryan
2026-06-28 8:10 ` Harry Yoo
2026-06-28 8:36 ` 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=5ebd3c4a-5c06-43b4-ab0a-7a8f0396c84c@kernel.org \
--to=harry@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=cl@gentwo.org \
--cc=dcostantino@meta.com \
--cc=hao.li@linux.dev \
--cc=kees@kernel.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=surenb@google.com \
--cc=usama.arif@linux.dev \
--cc=vbabka@kernel.org \
/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