Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756419Ab0LJPrB (ORCPT ); Fri, 10 Dec 2010 10:47:01 -0500 Received: from gir.skynet.ie ([193.1.99.77]:55810 "EHLO gir.skynet.ie" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756108Ab0LJPq2 (ORCPT ); Fri, 10 Dec 2010 10:46:28 -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 5/6] mm: kswapd: Treat zone->all_unreclaimable in sleeping_prematurely similar to balance_pgdat() Date: Fri, 10 Dec 2010 15:46:24 +0000 Message-Id: <1291995985-5913-6-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: 1258 Lines: 39 After DEF_PRIORITY, balance_pgdat() considers all_unreclaimable zones to be balanced but sleeping_prematurely does not. This can force kswapd to stay awake longer than it should. This patch fixes it. Signed-off-by: Mel Gorman --- mm/vmscan.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index e1be4e8..5995121 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2237,8 +2237,16 @@ static bool sleeping_prematurely(pg_data_t *pgdat, int order, long remaining) if (!populated_zone(zone)) continue; - if (zone->all_unreclaimable) + /* + * balance_pgdat() skips over all_unreclaimable after + * DEF_PRIORITY. Effectively, it considers them balanced so + * they must be considered balanced here as well if kswapd + * is to sleep + */ + if (zone->all_unreclaimable) { + balanced += zone->present_pages; continue; + } if (!zone_watermark_ok_safe(zone, order, high_wmark_pages(zone), 0, 0)) -- 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/