From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751326AbdILHPP (ORCPT ); Tue, 12 Sep 2017 03:15:15 -0400 Received: from mx2.suse.de ([195.135.220.15]:51730 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751258AbdILHPO (ORCPT ); Tue, 12 Sep 2017 03:15:14 -0400 Subject: Re: [PATCH] mm: respect the __GFP_NOWARN flag when warning about stalls To: Mikulas Patocka , Michal Hocko Cc: Tetsuo Handa , Johannes Weiner , Mel Gorman , Dave Hansen , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20170911082650.dqfirwc63xy7i33q@dhcp22.suse.cz> From: Vlastimil Babka Message-ID: Date: Tue, 12 Sep 2017 09:14:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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@dhcp22.suse.cz >> >>> >>> --- >>> 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 >> From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f69.google.com (mail-pg0-f69.google.com [74.125.83.69]) by kanga.kvack.org (Postfix) with ESMTP id ED5E66B0322 for ; Tue, 12 Sep 2017 03:15:15 -0400 (EDT) Received: by mail-pg0-f69.google.com with SMTP id j16so9882160pga.6 for ; Tue, 12 Sep 2017 00:15:15 -0700 (PDT) Received: from mx1.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id j10si7217854pgs.609.2017.09.12.00.15.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 12 Sep 2017 00:15:14 -0700 (PDT) Subject: Re: [PATCH] mm: respect the __GFP_NOWARN flag when warning about stalls References: <20170911082650.dqfirwc63xy7i33q@dhcp22.suse.cz> From: Vlastimil Babka Message-ID: Date: Tue, 12 Sep 2017 09:14:05 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Mikulas Patocka , Michal Hocko Cc: Tetsuo Handa , Johannes Weiner , Mel Gorman , Dave Hansen , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org 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@dhcp22.suse.cz >> >>> >>> --- >>> 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 >> -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org