Re: [PATCH] fix GFP zone modifier interators

From: Andrew Morton
Date: Thu Jun 24 2004 - 17:33:07 EST


Andy Whitcroft <apw@xxxxxxxxxxxx> wrote:
>
> For each node there are a defined list of MAX_NR_ZONES zones.
> These are selected as a result of the __GFP_DMA and __GFP_HIGHMEM
> zone modifier flags being passed to the memory allocator as part of
> the GFP mask. Each node has a set of zone lists, node_zonelists,
> which defines the list and order of zones to scan for each flag
> combination. When initialising these lists we iterate over
> modifier combinations 0 .. MAX_NR_ZONES. However, this is only
> correct when there are at most ZONES_SHIFT flags. If another flag
> is introduced zonelists for it would not be initialised.

I don't get it. If you were going to add a new zone, identified by
__GFP_WHATEVER then you'd need to increase MAX_NR_ZONES
anyway, wouldn't you?

I'm sure you're right, but I haven't worked on this stuff in months and
it's obscure. Care to explain a little more?

> This patch introduces GFP_ZONEMODS (based on GFP_ZONEMASK) as a
> bound for the number of modifier combinations.

The "ZONEMODS" identifier doesn't really grab me. ZONETYPES, or something?

Either way, please add a big fat comment over it, explaining to the poor reader
what its semantic meaning is.
-
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/