From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753823AbcFPJ3K (ORCPT ); Thu, 16 Jun 2016 05:29:10 -0400 Received: from mx2.suse.de ([195.135.220.15]:37142 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750902AbcFPJ3F (ORCPT ); Thu, 16 Jun 2016 05:29:05 -0400 Subject: Re: [PATCH 10/27] mm, vmscan: Clear congestion, dirty and need for compaction on a per-node basis To: Mel Gorman , Andrew Morton , Linux-MM References: <1465495483-11855-1-git-send-email-mgorman@techsingularity.net> <1465495483-11855-11-git-send-email-mgorman@techsingularity.net> Cc: Rik van Riel , Johannes Weiner , LKML From: Vlastimil Babka Message-ID: <510d374a-074e-cd32-bdbe-61754052b21b@suse.cz> Date: Thu, 16 Jun 2016 11:29:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1465495483-11855-11-git-send-email-mgorman@techsingularity.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/09/2016 08:04 PM, Mel Gorman wrote: > Congested and dirty tracking of a node and whether reclaim should stall > is still based on zone activity. This patch considers whether the kernel > should stall based on node-based reclaim activity. I'm a bit confused about the description vs actual code. It appears to move some duplicated code to a related function, which is fine. The rest of callsites that didn't perform the clearing before (prepare_kswapd_sleep() and wakeup_kswapd()) might be a bit overkill, but won't hurt. But I don't see the part "considers whether the kernel should stall based on node-based reclaim activity". Is something missing? > Signed-off-by: Mel Gorman > --- > mm/vmscan.c | 24 ++++++++++++------------ > 1 file changed, 12 insertions(+), 12 deletions(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index dd68e3154732..e4f3e068b7a0 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -2966,7 +2966,17 @@ static bool zone_balanced(struct zone *zone, int order, int classzone_idx) > { > unsigned long mark = high_wmark_pages(zone); > > - return zone_watermark_ok_safe(zone, order, mark, classzone_idx); > + if (!zone_watermark_ok_safe(zone, order, mark, classzone_idx)) > + return false; > + > + /* > + * If any eligible zone is balanced then the node is not considered > + * to be congested or dirty > + */ > + clear_bit(PGDAT_CONGESTED, &zone->zone_pgdat->flags); > + clear_bit(PGDAT_DIRTY, &zone->zone_pgdat->flags); > + > + return true; > } > > /* > @@ -3112,13 +3122,6 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx) > if (!zone_balanced(zone, order, 0)) { > classzone_idx = i; > break; > - } else { > - /* > - * If any eligible zone is balanced then the > - * node is not considered congested or dirty. > - */ > - clear_bit(PGDAT_CONGESTED, &zone->zone_pgdat->flags); > - clear_bit(PGDAT_DIRTY, &zone->zone_pgdat->flags); > } > } > > @@ -3177,11 +3180,8 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx) > if (!populated_zone(zone)) > continue; > > - if (zone_balanced(zone, sc.order, classzone_idx)) { > - clear_bit(PGDAT_CONGESTED, &pgdat->flags); > - clear_bit(PGDAT_DIRTY, &pgdat->flags); > + if (zone_balanced(zone, sc.order, classzone_idx)) > goto out; > - } > } > > /* >