Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756253Ab0LJPqa (ORCPT ); Fri, 10 Dec 2010 10:46:30 -0500 Received: from gir.skynet.ie ([193.1.99.77]:55802 "EHLO gir.skynet.ie" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756088Ab0LJPq1 (ORCPT ); Fri, 10 Dec 2010 10:46:27 -0500 From: Mel Gorman To: Andrew Morton Cc: Simon Kirby , KOSAKI Motohiro , Shaohua Li , Dave Hansen , Johannes Weiner , linux-mm , linux-kernel , Mel Gorman Subject: [PATCH 4/6] mm: kswapd: Reset kswapd_max_order and classzone_idx after reading Date: Fri, 10 Dec 2010 15:46:23 +0000 Message-Id: <1291995985-5913-5-git-send-email-mel@csn.ul.ie> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1291995985-5913-1-git-send-email-mel@csn.ul.ie> References: <1291995985-5913-1-git-send-email-mel@csn.ul.ie> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1361 Lines: 37 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 --- mm/vmscan.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 4d968b0..e1be4e8 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2646,6 +2646,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(); -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/