Re: [PATCH v2 08/16] mm/slab: pass alloc_flags to new slab allocation

From: Vlastimil Babka (SUSE)

Date: Fri Jun 12 2026 - 05:59:54 EST


On 6/12/26 07:26, Hao Li wrote:
> On Wed, Jun 10, 2026 at 05:40:10PM +0200, Vlastimil Babka (SUSE) wrote:
>> --- a/mm/slub.c
>> +++ b/mm/slub.c
>> @@ -3378,9 +3378,10 @@ static __always_inline void unaccount_slab(struct slab *slab, int order,
>> }
>>
>> /* Allocate and initialize a slab without building its freelist. */
>> -static struct slab *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
>> +static struct slab *allocate_slab(struct kmem_cache *s, gfp_t flags,
>> + unsigned int alloc_flags, int node)
>> {
>> - bool allow_spin = gfpflags_allow_spinning(flags);
>> + bool allow_spin = alloc_flags_allow_spinning(alloc_flags);
>
> nit: allow_spin doesn't depend on `flags` now, so it seems we can delete the
> comments:
>
> /*
> * __GFP_RECLAIM could be cleared on the first allocation attempt,
> * so pass allow_spin flag directly.
> */

Right, deleted.

> Otherwise, looks good to me.
> Reviewed-by: Hao Li <hao.li@xxxxxxxxx>

Thanks!