Re: [PATCH v4 2/2] slab: Introduce kmalloc_obj() and family

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 3/14/25 10:18 PM, Gustavo A. R. Silva wrote:
> 
>> These each return the assigned value of ptr (which may be NULL on
>> failure). For cases where the total size of the allocation is needed,
>> the kmalloc_obj_sz(), kmalloc_objs_sz(), and kmalloc_flex_sz() family
>> of macros can be used. For example:
>>
>>     info->size = struct_size(ptr, flex_member, count);
>>     ptr = kmalloc(info->size, gfp);
>>
>> becomes:
>>
>>     kmalloc_flex_sz(ptr, flex_member, count, gfp, &info->size);
> 
> I wonder if it'd be better to keep the gfp flags as the last argument
> for all these `*_sz()` cases:

That was my reaction when I reviewed the patch also. [I just didn't express it.]

> 
>     kmalloc_flex_sz(ptr, flex_member, count, &info->size, gpf);
> 
> Probably, even for __alloc_objs()


-- 
~Randy





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux