Re: [patch for-5.3 0/4] revert immediate fallback to remote hugepages

From: Vlastimil Babka
Date: Thu Oct 03 2019 - 04:00:13 EST


On 10/3/19 12:32 AM, David Rientjes wrote:
> On Wed, 2 Oct 2019, Michal Hocko wrote:
>
>>>> If
>>>> hugetlb wants to stress this to the fullest extent possible, it already
>>>> appropriately uses __GFP_RETRY_MAYFAIL.
>>>
>>> Which doesn't work anymore right now, and should again after this patch.
>>
>> I didn't get to fully digest the patch Vlastimil is proposing. (Ab)using
>> __GFP_NORETRY is quite subtle but it is already in place with some
>> explanation and a reference to THPs. So while I am not really happy it
>> is at least something you can reason about.
>>
>
> It's a no-op:
>
> /* Do not loop if specifically requested */
> if (gfp_mask & __GFP_NORETRY)
> goto nopage;
>
> /*
> * Do not retry costly high order allocations unless they are
> * __GFP_RETRY_MAYFAIL
> */
> if (costly_order && !(gfp_mask & __GFP_RETRY_MAYFAIL))
> goto nopage;
>
> So I'm not sure we should spend too much time discussing a hunk of a patch
> that doesn't do anything.

I believe Michal was talking about my (ab)use of __GFP_NORETRY, where it
controls the earlier 'goto nopage' condition. Yes, with your patches alone,
the addition of __GFP_NORETRY in the second attempt is a no-op, although
then I don't see the point of confusing people reading the code with it.