Commit 6256c6b4 authored by Mel Gorman's avatar Mel Gorman Committed by Linus Torvalds

mm, vmscan: remove duplicate logic clearing node congestion and dirty state

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.

Link: http://lkml.kernel.org/r/1467970510-21195-12-git-send-email-mgorman@techsingularity.netSigned-off-by: default avatarMel Gorman <mgorman@techsingularity.net>
Acked-by: default avatarHillf Danton <hillf.zj@alibaba-inc.com>
Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Rik van Riel <riel@surriel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 79dafcdc
...@@ -3008,7 +3008,17 @@ static bool zone_balanced(struct zone *zone, int order, int classzone_idx) ...@@ -3008,7 +3008,17 @@ static bool zone_balanced(struct zone *zone, int order, int classzone_idx)
{ {
unsigned long mark = high_wmark_pages(zone); 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;
} }
/* /*
...@@ -3154,13 +3164,6 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx) ...@@ -3154,13 +3164,6 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx)
if (!zone_balanced(zone, order, 0)) { if (!zone_balanced(zone, order, 0)) {
classzone_idx = i; classzone_idx = i;
break; 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);
} }
} }
...@@ -3219,12 +3222,9 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx) ...@@ -3219,12 +3222,9 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx)
if (!populated_zone(zone)) if (!populated_zone(zone))
continue; continue;
if (zone_balanced(zone, sc.order, classzone_idx)) { if (zone_balanced(zone, sc.order, classzone_idx))
clear_bit(PGDAT_CONGESTED, &pgdat->flags);
clear_bit(PGDAT_DIRTY, &pgdat->flags);
goto out; goto out;
} }
}
/* /*
* Raise priority if scanning rate is too low or there was no * Raise priority if scanning rate is too low or there was no
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment