Re: [PATCH] mm: respect the __GFP_NOWARN flag when warning about stalls
From: Vlastimil Babka
Date: Tue Sep 12 2017 - 03:15:22 EST
On 09/12/2017 01:36 AM, Mikulas Patocka wrote:
>
>
> On Mon, 11 Sep 2017, Michal Hocko wrote:
>
>> On Mon 11-09-17 02:52:53, Mikulas Patocka wrote:
>>
>> This patch hasn't introduced this behavior. It deliberately skipped
>> warning on __GFP_NOWARN. This has been introduced later by 822519634142
>> ("mm: page_alloc: __GFP_NOWARN shouldn't suppress stall warnings"). I
>> disagreed [1] but overall consensus was that such a warning won't be
>> harmful. Could you be more specific why do you consider it wrong,
>> please?
>
> I consider the warning wrong, because it warns when nothing goes wrong.
> I've got 7 these warnings for 4 weeks of uptime. The warnings typically
> happen when I run some compilation.
>
> A process with low priority is expected to be running slowly when there's
> some high-priority process, so there's no need to warn that the
> low-priority process runs slowly.
>
> What else can be done to avoid the warning? Skip the warning if the
> process has lower priority?
We would have to consider (instead of jiffies) the time the process was
either running, or waiting on something that's related to memory
allocation/reclaim (page lock etc.). I.e. deduct the time the process
was runable but there was no available cpu. I expect however that such
level of detail wouldn't be feasible here, though?
Vlastimil
> Mikulas
>
>> [1] http://lkml.kernel.org/r/20170125184548.GB32041@xxxxxxxxxxxxxx
>>
>>>
>>> ---
>>> mm/page_alloc.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> Index: linux-2.6/mm/page_alloc.c
>>> ===================================================================
>>> --- linux-2.6.orig/mm/page_alloc.c
>>> +++ linux-2.6/mm/page_alloc.c
>>> @@ -3923,7 +3923,7 @@ retry:
>>>
>>> /* Make sure we know about allocations which stall for too long */
>>> if (time_after(jiffies, alloc_start + stall_timeout)) {
>>> - warn_alloc(gfp_mask & ~__GFP_NOWARN, ac->nodemask,
>>> + warn_alloc(gfp_mask, ac->nodemask,
>>> "page allocation stalls for %ums, order:%u",
>>> jiffies_to_msecs(jiffies-alloc_start), order);
>>> stall_timeout += 10 * HZ;
>>
>> --
>> Michal Hocko
>> SUSE Labs
>>