lkml.org 
[lkml]   [2009]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.


\
 
 \ /
  Last update: 2009-03-19 19:21    [from the cache]
©2003-2011 Jasper Spaans