From: Mel Gorman Date: Thu, 13 Jan 2011 23:46:23 +0000 (-0800) Subject: mm: kswapd: reset kswapd_max_order and classzone_idx after reading X-Git-Tag: upstream/snapshot3+hdmi~11841 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d40502ea580c35414a1466d86f96484910ebaec;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Reviewed-by: Minchan Kim Reviewed-by: KAMEZAWA Hiroyuki Reviewed-by: Eric B Munson Cc: Simon Kirby Cc: KOSAKI Motohiro Cc: Shaohua Li Cc: Dave Hansen Cc: Johannes Weiner Cc: Rik van Riel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/vmscan.c b/mm/vmscan.c index 46711f0..dafb9d9 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2653,6 +2653,8 @@ static int kswapd(void *p) kswapd_try_to_sleep(pgdat, order); order = pgdat->kswapd_max_order; classzone_idx = pgdat->classzone_idx; + pgdat->kswapd_max_order = 0; + pgdat->classzone_idx = MAX_NR_ZONES - 1; } ret = try_to_freeze();