diff options
author | Mel Gorman <[email protected]> | 2013-07-03 15:01:53 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2013-07-03 16:07:28 -0700 |
commit | b7ea3c417b6c2e74ca1cb051568f60377908928d (patch) | |
tree | 2f1f5dccc02d1fc0ac4a7dd4d6bbe88757b7e675 | |
parent | 283aba9f9e0e4882bf09bd37a2983379a6fae805 (diff) | |
download | linux-b7ea3c417b6c2e74ca1cb051568f60377908928d.tar.gz |
mm: vmscan: check if kswapd should writepage once per pgdat scan
Currently kswapd checks if it should start writepage as it shrinks each
zone without taking into consideration if the zone is balanced or not.
This is not wrong as such but it does not make much sense either. This
patch checks once per pgdat scan if kswapd should be writing pages.
Signed-off-by: Mel Gorman <[email protected]>
Reviewed-by: Michal Hocko <[email protected]>
Acked-by: Rik van Riel <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Cc: KAMEZAWA Hiroyuki <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Valdis Kletnieks <[email protected]>
Tested-by: Zlatko Calusic <[email protected]>
Cc: dormando <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | mm/vmscan.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 1109de0c35bf45..a2d0c68426169e 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2853,6 +2853,13 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order, } /* + * If we're getting trouble reclaiming, start doing writepage + * even in laptop mode. + */ + if (sc.priority < DEF_PRIORITY - 2) + sc.may_writepage = 1; + + /* * Now scan the zone in the dma->highmem direction, stopping * at the last zone which needs scanning. * @@ -2923,13 +2930,6 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order, raise_priority = false; } - /* - * If we're getting trouble reclaiming, start doing - * writepage even in laptop mode. - */ - if (sc.priority < DEF_PRIORITY - 2) - sc.may_writepage = 1; - if (zone->all_unreclaimable) { if (end_zone && end_zone == i) end_zone--; |