[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1009011935040.20518@router.home>
Date: Wed, 1 Sep 2010 19:39:43 -0500 (CDT)
From: Christoph Lameter <cl@...ux.com>
To: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
cc: Mel Gorman <mel@....ul.ie>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel List <linux-kernel@...r.kernel.org>,
linux-mm@...ck.org, Rik van Riel <riel@...hat.com>,
Johannes Weiner <hannes@...xchg.org>,
Minchan Kim <minchan.kim@...il.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Subject: Re: [PATCH 2/3] mm: page allocator: Calculate a better estimate of
NR_FREE_PAGES when memory is low and kswapd is awake
On Thu, 2 Sep 2010, KOSAKI Motohiro wrote:
> > nr_free_pages += delta;
> > if (nr_free_pages < 0)
> > nr_free_pages = 0;
>
> nr_free_pages is unsined. this wouldn't works ;)
The VM counters are signed and must be signed otherwise the deferred
update scheme would cause desasters. For treatment in the page allocator
these may be converted to unsigned.
The effect needs to be the same as retrieving a global or
zone ZVC counter. Which is currently implemented in the following way:
static inline unsigned long zone_page_state(struct zone *zone,
enum zone_stat_item item)
{
long x = atomic_long_read(&zone->vm_stat[item]);
#ifdef CONFIG_SMP
if (x < 0)
x = 0;
#endif
return x;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists