[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.10.0903191413560.17408@qirst.com>
Date: Thu, 19 Mar 2009 14:15:32 -0400 (EDT)
From: Christoph Lameter <cl@...ux-foundation.org>
To: Mel Gorman <mel@....ul.ie>
cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Linux Memory Management List <linux-mm@...ck.org>,
Pekka Enberg <penberg@...helsinki.fi>,
Rik van Riel <riel@...hat.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Johannes Weiner <hannes@...xchg.org>,
Nick Piggin <npiggin@...e.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Lin Ming <ming.m.lin@...el.com>,
Zhang Yanmin <yanmin_zhang@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 24/27] Convert gfp_zone() to use a table of precalculated
values
On Thu, 19 Mar 2009, Mel Gorman wrote:
> I ran into exactly that problem and ended up shoving the table into
> page_alloc.c but then there is no benefits from having the table statically
> declared because there is no constant folding.
Right. The table must be defined in the .h file. Just a matter of figuring
out how to convince the compiler/linker to do the right thing.
> > + if (__builtin_constant_p(zone))
> > + BUILD_BUG_ON(zone == BAD_ZONE);
> > +#ifdef CONFIG_DEBUG_VM
> > + else
> > + BUG_ON(zone == BAD_ZONE);
> > #endif
>
> That could be made a bit prettier with
>
> if (__builtin_constant_p(zone))
> BUILD_BUG_ON(zone == BAD_ZONE);
> VM_BUG_ON(zone == BAD_ZONE);
VM_BUG_ON is not available here. It has to be that ugly.
--
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