[PATCH] linearly index zone->node_zonelists[]
I wonder why we need this bitmask indexing into zone->node_zonelists[]? We always start with the highest zone and then include all lower zones if we build zonelists. Are there really cases where we need allocation from ZONE_DMA or ZONE_HIGHMEM but not ZONE_NORMAL? It seems that the current implementation of highest_zone() makes that already impossible. If we go linear on the index then gfp_zone() == highest_zone() and a lot of definitions fall by the wayside. We can now revert back to the use of gfp_zone() in mempolicy.c ;-) Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
2f6726e54a
commit
19655d3487
@@ -12,9 +12,6 @@ struct vm_area_struct;
|
||||
*
|
||||
* Zone modifiers (see linux/mmzone.h - low three bits)
|
||||
*
|
||||
* These may be masked by GFP_ZONEMASK to make allocations with this bit
|
||||
* set fall back to ZONE_NORMAL.
|
||||
*
|
||||
* Do not put any conditional on these. If necessary modify the definitions
|
||||
* without the underscores and use the consistently. The definitions here may
|
||||
* be used in bit comparisons.
|
||||
@@ -78,14 +75,7 @@ struct vm_area_struct;
|
||||
#define GFP_DMA32 __GFP_DMA32
|
||||
|
||||
|
||||
static inline int gfp_zone(gfp_t gfp)
|
||||
{
|
||||
int zone = GFP_ZONEMASK & (__force int) gfp;
|
||||
BUG_ON(zone >= GFP_ZONETYPES);
|
||||
return zone;
|
||||
}
|
||||
|
||||
static inline enum zone_type highest_zone(gfp_t flags)
|
||||
static inline enum zone_type gfp_zone(gfp_t flags)
|
||||
{
|
||||
if (flags & __GFP_DMA)
|
||||
return ZONE_DMA;
|
||||
|
||||
Reference in New Issue
Block a user