path: root/mm
diff options
authorMel Gorman <>2017-02-24 14:59:07 -0800
committerLinus Torvalds <>2017-02-24 17:46:55 -0800
commitc2f83143f1c67d186520b72b6cefbf0aa07a34ee (patch)
tree91e1437faa00f552fb68c1c339c9d4f446b2ac01 /mm
parent8f526e12426e284b7d5d659b6b2e8920fa7c9ed9 (diff)
mm, vmscan: clear PGDAT_WRITEBACK when zone is balanced
Hillf Danton pointed out that since commit 1d82de618dd ("mm, vmscan: make kswapd reclaim in terms of nodes") that PGDAT_WRITEBACK is no longer cleared. It was not noticed as triggering it requires pages under writeback to cycle twice through the LRU and before kswapd gets stalled. Historically, such issues tended to occur on small machines writing heavily to slow storage such as a USB stick. Once kswapd stalls, direct reclaim stalls may be higher but due to the fact that memory pressure is required, it would not be very noticable. Michal Hocko suggested removing the flag entirely but the conservative fix is to restore the intended PGDAT_WRITEBACK behaviour and clear the flag when a suitable zone is balanced. Fixes: 1d82de618ddd ("mm, vmscan: make kswapd reclaim in terms of nodes") Link: Signed-off-by: Mel Gorman <> Acked-by: Johannes Weiner <> Acked-by: Michal Hocko <> Acked-by: Hillf Danton <> Cc: Minchan Kim <> Cc: Rik van Riel <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm')
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index ae3d982..70aa739 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -3096,6 +3096,7 @@ static bool zone_balanced(struct zone *zone, int order, int classzone_idx)
clear_bit(PGDAT_CONGESTED, &zone->zone_pgdat->flags);
clear_bit(PGDAT_DIRTY, &zone->zone_pgdat->flags);
+ clear_bit(PGDAT_WRITEBACK, &zone->zone_pgdat->flags);
return true;