Re: [PATCH] numa: fix slab_node(MPOL_BIND)

From: Christoph Lameter
Date: Fri Oct 29 2010 - 10:55:21 EST


On Thu, 28 Oct 2010, Andrew Morton wrote:

> On Thu, 28 Oct 2010 11:55:18 -0500 (CDT)
> Christoph Lameter <cl@xxxxxxxxx> wrote:
>
> > On Thu, 28 Oct 2010, Linus Torvalds wrote:
> >
> > > And so does - although less obviously - mm/vmscan.c for the
> > > wait_iff_confgested() thing.
> > >
> > > So are those buggy too, since first_zones_zonelist() can apparently return NULL?
> >
> > The code is fine.
> >
> > first_zones_zonelist() can only return NULL for the case that a nodemask
> > was specified and the code in vmscan.c does not specify a nodemask.
>
> Geeze, how did you work that out and how the heck was anyone else
> supposed to know this :(

Look at the code and how it was modified by Lee. The initial assumption
before his patch was that the zonelist contains all zones of the system.
Therefore you will allways find all possible zone types in the system.
The function did not contain a check for the end of the zonelist and does
not now for the nodemask == NULL.

However, the modification to filter the zonelist then makes it possible to
have subsets of zones not containing the requested zone types now.
Therefore Lee added a check for the end of the zonelist for that case.

Could be better documented. Took me some staring at the code to figure it
out.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/