Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757755Ab1F1Mxd (ORCPT ); Tue, 28 Jun 2011 08:53:33 -0400 Received: from cantor2.suse.de ([195.135.220.15]:46379 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755412Ab1F1Mwz (ORCPT ); Tue, 28 Jun 2011 08:52:55 -0400 Date: Tue, 28 Jun 2011 13:52:49 +0100 From: Mel Gorman To: Minchan Kim Cc: Andrew Morton , P?draig Brady , James Bottomley , Colin King , Andrew Lutomirski , Rik van Riel , Johannes Weiner , linux-mm , linux-kernel Subject: Re: [PATCH 3/4] mm: vmscan: Evaluate the watermarks against the correct classzone Message-ID: <20110628125249.GX9396@suse.de> References: <1308926697-22475-1-git-send-email-mgorman@suse.de> <1308926697-22475-4-git-send-email-mgorman@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2157 Lines: 57 On Mon, Jun 27, 2011 at 03:53:04PM +0900, Minchan Kim wrote: > On Fri, Jun 24, 2011 at 11:44 PM, Mel Gorman wrote: > > When deciding if kswapd is sleeping prematurely, the classzone is > > taken into account but this is different to what balance_pgdat() and > > the allocator are doing. Specifically, the DMA zone will be checked > > based on the classzone used when waking kswapd which could be for a > > GFP_KERNEL or GFP_HIGHMEM request. The lowmem reserve limit kicks in, > > the watermark is not met and kswapd thinks its sleeping prematurely > > keeping kswapd awake in error. > > > I thought it was intentional when you submitted a patch firstly. It was, it also wasn't right. > "Kswapd makes sure zones include enough free pages(ie, include reserve > limit of above zones). > But you seem to see DMA zone can't meet above requirement forever in > some situation so that kswapd doesn't sleep. > Right? > Right. > > > > Reported-and-tested-by: P?draig Brady > > Signed-off-by: Mel Gorman > > --- > > ?mm/vmscan.c | ? ?2 +- > > ?1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/mm/vmscan.c b/mm/vmscan.c > > index 9cebed1..a76b6cc2 100644 > > --- a/mm/vmscan.c > > +++ b/mm/vmscan.c > > @@ -2341,7 +2341,7 @@ static bool sleeping_prematurely(pg_data_t *pgdat, int order, long remaining, > > ? ? ? ? ? ? ? ?} > > > > ? ? ? ? ? ? ? ?if (!zone_watermark_ok_safe(zone, order, high_wmark_pages(zone), > > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? classzone_idx, 0)) > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? i, 0)) > > Isn't it better to use 0 instead of i? > I considered it but went with i to compromise between making sure zones included enough free pages without requiring that ZONE_DMA meet an almost impossible requirement when under continual memory pressure. -- Mel Gorman SUSE Labs -- 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/