Re: [PATCH v2 12/16] mm/slab: pass slab_alloc_context to __do_kmalloc_node()
From: Vlastimil Babka (SUSE)
Date: Mon Jun 15 2026 - 07:09:25 EST
On 6/15/26 06:58, Suren Baghdasaryan wrote:
> On Wed, Jun 10, 2026 at 8:41 AM Vlastimil Babka (SUSE)
> <vbabka@xxxxxxxxxx> wrote:
>>
>> With alloc_flags usage in slab, we can replace __GFP_NO_OBJ_EXT with an
>> alloc flag that prevents kmalloc recursion. For that we need a version
>> of kmalloc() that takes alloc_flags and use it in places that perform
>> these potentially recursive kmalloc allocations (of sheaves or obj_ext
>> arrays).
>>
>> As a preparatory step, make __do_kmalloc_node() take a pointer to
>> slab_alloc_context. This replaces the 'caller' parameter and includes
>> alloc_flags which we'll make use of.
>
> I think you could also eliminate __do_kmalloc_node() function's "size"
> parameter as it's always the same as ac->orig_size.
OK, done.