Re: [PATCH RFC hotfixes 2/2] mm/slab: prevent unbounded recursion in free path with new kmalloc type
From: Vlastimil Babka (SUSE)
Date: Fri Jul 03 2026 - 04:40:52 EST
On 7/2/26 15:20, Harry Yoo wrote:
>
>
> On 7/2/26 9:57 PM, Vlastimil Babka (SUSE) wrote:
>>>
>>> To achieve this, create a new kmalloc type called KMALLOC_NO_OBJ_EXT.
>>> KMALLOC_NO_OBJ_EXT caches are created when CONFIG_SLAB_OBJ_EXT is
>>> enabled, and they have SLAB_NO_OBJ_EXT flag to prevent allocation
>>> of obj_exts arrays. They remain unused until allocation of obj_exts
>>> arrays for normal kmalloc caches happens.
>>
>> I wonder if we should just use them always (not just for kmalloc_normal) if
>> we already have them. Would there be any downside?
>
> Good point!
>
> That's more intuitive and sounds like it's good to separate them because
> likely obj_exts will have longer lifetime than slab objects.
>
> Not sure about impact on memory usage, need to check.
> I'd say it's fine as long as it doesn't clearly increase memory usage.
Yeah there might be more usage due to separate slabs, sheaves etc. But maybe
also less because the separated lifetime, thus potentially lower internal
fragmentation.
> But I guess that should not be part of bugfix as it's a functional
> change that is not required to fix the bug.
Ack.