aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2011-01-13 18:46:23 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 20:32:37 -0500
commit4d40502ea580c35414a1466d86f96484910ebaec (patch)
treeed03d2b5a100be1c3371d304421af221fa893129 /mm
parent0abdee2bd4118366c62349a304f81537be69af33 (diff)
mm: kswapd: reset kswapd_max_order and classzone_idx after reading
When kswapd wakes up, it reads its order and classzone from pgdat and calls balance_pgdat. While its awake, it potentially reclaimes at a high order and a low classzone index. This might have been a once-off that was not required by subsequent callers. However, because the pgdat values were not reset, they remain artifically high while balance_pgdat() is running and potentially kswapd enters a second unnecessary reclaim cycle. Reset the pgdat order and classzone index after reading. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Reviewed-by: Minchan Kim <minchan.kim@gmail.com> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Reviewed-by: Eric B Munson <emunson@mgebm.net> Cc: Simon Kirby <sim@hostway.ca> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Shaohua Li <shaohua.li@intel.com> Cc: Dave Hansen <dave@linux.vnet.ibm.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Rik van Riel <riel@redhat.com> 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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 46711f080f38..dafb9d91b604 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2653,6 +2653,8 @@ static int kswapd(void *p)
2653 kswapd_try_to_sleep(pgdat, order); 2653 kswapd_try_to_sleep(pgdat, order);
2654 order = pgdat->kswapd_max_order; 2654 order = pgdat->kswapd_max_order;
2655 classzone_idx = pgdat->classzone_idx; 2655 classzone_idx = pgdat->classzone_idx;
2656 pgdat->kswapd_max_order = 0;
2657 pgdat->classzone_idx = MAX_NR_ZONES - 1;
2656 } 2658 }
2657 2659
2658 ret = try_to_freeze(); 2660 ret = try_to_freeze();