From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f72.google.com (mail-wm0-f72.google.com [74.125.82.72]) by kanga.kvack.org (Postfix) with ESMTP id B61296B025E for ; Fri, 1 Jul 2016 16:03:34 -0400 (EDT) Received: by mail-wm0-f72.google.com with SMTP id c82so25875254wme.2 for ; Fri, 01 Jul 2016 13:03:34 -0700 (PDT) Received: from outbound-smtp06.blacknight.com (outbound-smtp06.blacknight.com. [81.17.249.39]) by mx.google.com with ESMTPS id l8si4451426wmf.15.2016.07.01.13.03.33 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 01 Jul 2016 13:03:33 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp06.blacknight.com (Postfix) with ESMTPS id 5B07798A9B for ; Fri, 1 Jul 2016 20:03:33 +0000 (UTC) From: Mel Gorman Subject: [PATCH 10/31] mm, vmscan: remove duplicate logic clearing node congestion and dirty state Date: Fri, 1 Jul 2016 21:01:18 +0100 Message-Id: <1467403299-25786-11-git-send-email-mgorman@techsingularity.net> In-Reply-To: <1467403299-25786-1-git-send-email-mgorman@techsingularity.net> References: <1467403299-25786-1-git-send-email-mgorman@techsingularity.net> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton , Linux-MM Cc: Rik van Riel , Vlastimil Babka , Johannes Weiner , LKML , Mel Gorman Reclaim may stall if there is too much dirty or congested data on a node. This was previously based on zone flags and the logic for clearing the flags is in two places. As congestion/dirty tracking is now tracked on a per-node basis, we can remove some duplicate logic. 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 34656173a670..911142d25de2 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3005,7 +3005,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; } /* @@ -3151,13 +3161,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); } } @@ -3216,11 +3219,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; - } } /* -- 2.6.4 -- 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