Re: [patch 2/3] Fix GFP_THISNODE behavior for memoryless nodes

David Rientjes
2007-06-12T21:08:58Z

On Tue, 12 Jun 2007, Christoph Lameter wrote:

> On Tue, 12 Jun 2007, David Rientjes wrote:
>
> > > ===================================================================
> > > --- linux-2.6.22-rc4-mm2.orig/include/linux/gfp.h 2007-06-12 12:33:37.000000000 -0700
> > > +++ linux-2.6.22-rc4-mm2/include/linux/gfp.h 2007-06-12 12:38:37.000000000 -0700
> > > @@ -175,6 +175,13 @@ static inline struct page *alloc_pages_n
> > > if (nid < 0)
> > > nid = numa_node_id();
> > >
> > > + /*
> > > + * Check for the special case that GFP_THISNODE is used on a
> > > + * memoryless node
> > > + */
> > > + if ((gfp_mask & __GFP_THISNODE) && !node_memory(nid))
> > > + return NULL;
> > > +
> >
> > unlikely()?
>
> The gfp_mask is typically constant. So the whole expression is folded by the
> compiler into either
>
> if (!node_memory(nid))
> return NULL
>
> or
>
> nothing.
>

That's the point. Isn't !node_memory(nid) unlikely?