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-Url: https://git.stricted.de/?a=commitdiff_plain;h=4d40502ea580c35414a1466d86f96484910ebaec;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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 46711f080f38..dafb9d91b604 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();