From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail137.messagelabs.com (mail137.messagelabs.com [216.82.249.19]) by kanga.kvack.org (Postfix) with SMTP id 97E106B004A for ; Wed, 1 Sep 2010 20:49:09 -0400 (EDT) Received: from m4.gw.fujitsu.co.jp ([10.0.50.74]) by fgwmail7.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o820n7Do010922 for (envelope-from kosaki.motohiro@jp.fujitsu.com); Thu, 2 Sep 2010 09:49:07 +0900 Received: from smail (m4 [127.0.0.1]) by outgoing.m4.gw.fujitsu.co.jp (Postfix) with ESMTP id E0CEB45DE80 for ; Thu, 2 Sep 2010 09:49:06 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (s4.gw.fujitsu.co.jp [10.0.50.94]) by m4.gw.fujitsu.co.jp (Postfix) with ESMTP id B240245DE70 for ; Thu, 2 Sep 2010 09:49:06 +0900 (JST) Received: from s4.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 91BB01DB803B for ; Thu, 2 Sep 2010 09:49:06 +0900 (JST) Received: from ml13.s.css.fujitsu.com (ml13.s.css.fujitsu.com [10.249.87.103]) by s4.gw.fujitsu.co.jp (Postfix) with ESMTP id 41A831DB8040 for ; Thu, 2 Sep 2010 09:49:06 +0900 (JST) From: KOSAKI Motohiro Subject: Re: [PATCH 2/3] mm: page allocator: Calculate a better estimate of NR_FREE_PAGES when memory is low and kswapd is awake In-Reply-To: References: <1283276257-1793-3-git-send-email-mel@csn.ul.ie> Message-Id: <20100902094830.D068.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Thu, 2 Sep 2010 09:49:04 +0900 (JST) Sender: owner-linux-mm@kvack.org To: Christoph Lameter Cc: kosaki.motohiro@jp.fujitsu.com, Mel Gorman , Andrew Morton , Linux Kernel List , linux-mm@kvack.org, Rik van Riel , Johannes Weiner , Minchan Kim , KAMEZAWA Hiroyuki List-ID: > On Tue, 31 Aug 2010, Mel Gorman wrote: > > > +#ifdef CONFIG_SMP > > +/* Called when a more accurate view of NR_FREE_PAGES is needed */ > > +unsigned long zone_nr_free_pages(struct zone *zone) > > +{ > > + unsigned long nr_free_pages = zone_page_state(zone, NR_FREE_PAGES); > > You cannot call zone_page_state here because zone_page_state clips the > counter at zero. The nr_free_pages needs to reflect the unclipped state > and then the deltas need to be added. Then the clipping at zero can be > done. Good spotting. you are right. -- 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/ . Don't email: email@kvack.org