aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2013-07-03 18:01:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:07:28 -0400
commitb7ea3c417b6c2e74ca1cb051568f60377908928d (patch)
tree2f1f5dccc02d1fc0ac4a7dd4d6bbe88757b7e675 /mm
parent283aba9f9e0e4882bf09bd37a2983379a6fae805 (diff)
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 <mgorman@suse.de> Reviewed-by: Michal Hocko <mhocko@suse.cz> Acked-by: Rik van Riel <riel@redhat.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Jiri Slaby <jslaby@suse.cz> Cc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu> Tested-by: Zlatko Calusic <zcalusic@bitsync.net> Cc: dormando <dormando@rydia.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/vmscan.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 1109de0c35bf..a2d0c6842616 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2853,6 +2853,13 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order,
2853 } 2853 }
2854 2854
2855 /* 2855 /*
2856 * If we're getting trouble reclaiming, start doing writepage
2857 * even in laptop mode.
2858 */
2859 if (sc.priority < DEF_PRIORITY - 2)
2860 sc.may_writepage = 1;
2861
2862 /*
2856 * Now scan the zone in the dma->highmem direction, stopping 2863 * Now scan the zone in the dma->highmem direction, stopping
2857 * at the last zone which needs scanning. 2864 * at the last zone which needs scanning.
2858 * 2865 *
@@ -2923,13 +2930,6 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order,
2923 raise_priority = false; 2930 raise_priority = false;
2924 } 2931 }
2925 2932
2926 /*
2927 * If we're getting trouble reclaiming, start doing
2928 * writepage even in laptop mode.
2929 */
2930 if (sc.priority < DEF_PRIORITY - 2)
2931 sc.may_writepage = 1;
2932
2933 if (zone->all_unreclaimable) { 2933 if (zone->all_unreclaimable) {
2934 if (end_zone && end_zone == i) 2934 if (end_zone && end_zone == i)
2935 end_zone--; 2935 end_zone--;