Re: [PATCH v2 1/6] mm/huge_memory: add two new (yet used) functions for folio_split()
From: Zi Yan
Date: Thu Nov 07 2024 - 10:01:36 EST
>>
>>> +
>>> + if (mapping) {
>>> + /*
>>> + * uniform split has xas_split_alloc() called before
>>> + * irq is disabled, since xas_nomem() might not be
>>> + * able to allocate enough memory.
>>> + */
>>> + if (uniform_split)
>>> + xas_split(xas, folio, old_order);
>>> + else {
>>> + xas_set_order(xas, folio->index, split_order);
>>> + xas_set_err(xas, -ENOMEM);
>>> + if (xas_nomem(xas, 0))
>>
>> 0 gfp?
>
> This is inside lru_lock and allocation cannot sleep, so I am not sure
> current_gfp_context(mapping_gfp_mask(mapping) & GFP_RECLAIM_MASK); can
> be used.
>
> I need Matthew to help me out about this.
Talked to Matthew about this, will use GFP_NOWAIT here, since we can fail
here and probably should not get into atomic reserves.
Best Regards,
Yan, Zi