From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail203.messagelabs.com (mail203.messagelabs.com [216.82.254.243]) by kanga.kvack.org (Postfix) with ESMTP id 43A546B008A for ; Thu, 9 Dec 2010 06:18:25 -0500 (EST) From: Mel Gorman Subject: [PATCH 4/6] mm: kswapd: Reset kswapd_max_order and classzone_idx after reading Date: Thu, 9 Dec 2010 11:18:18 +0000 Message-Id: <1291893500-12342-5-git-send-email-mel@csn.ul.ie> In-Reply-To: <1291893500-12342-1-git-send-email-mel@csn.ul.ie> References: <1291893500-12342-1-git-send-email-mel@csn.ul.ie> Sender: owner-linux-mm@kvack.org To: Simon Kirby Cc: KOSAKI Motohiro , Shaohua Li , Dave Hansen , Johannes Weiner , Andrew Morton , linux-mm , linux-kernel , Mel Gorman List-ID: 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 --- mm/vmscan.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 52e229e..bc233d8 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2530,6 +2530,8 @@ static int kswapd(void *p) order = pgdat->kswapd_max_order; classzone_idx = pgdat->classzone_idx; + pgdat->kswapd_max_order = 0; + pgdat->classzone_idx = MAX_NR_ZONES - 1; } finish_wait(&pgdat->kswapd_wait, &wait); -- 1.7.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: email@kvack.org