Commit 8cece85e authored by KAMEZAWA Hiroyuki's avatar KAMEZAWA Hiroyuki Committed by Linus Torvalds

mm: fix broken gfp_zone with __GFP_THISNODE

This hack, "base = MAX_NR_ZONES", at __GFP_THISNODE was used for old
zonliests.

Now, new zonelist[] have a list for __GFP_THISNODE and this hack is incorrect.
Should be removed.
Signed-off-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Christoph Lameter <clameter@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2309f9e6
...@@ -119,29 +119,22 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags) ...@@ -119,29 +119,22 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags)
static inline enum zone_type gfp_zone(gfp_t flags) static inline enum zone_type gfp_zone(gfp_t flags)
{ {
int base = 0;
#ifdef CONFIG_NUMA
if (flags & __GFP_THISNODE)
base = MAX_NR_ZONES;
#endif
#ifdef CONFIG_ZONE_DMA #ifdef CONFIG_ZONE_DMA
if (flags & __GFP_DMA) if (flags & __GFP_DMA)
return base + ZONE_DMA; return ZONE_DMA;
#endif #endif
#ifdef CONFIG_ZONE_DMA32 #ifdef CONFIG_ZONE_DMA32
if (flags & __GFP_DMA32) if (flags & __GFP_DMA32)
return base + ZONE_DMA32; return ZONE_DMA32;
#endif #endif
if ((flags & (__GFP_HIGHMEM | __GFP_MOVABLE)) == if ((flags & (__GFP_HIGHMEM | __GFP_MOVABLE)) ==
(__GFP_HIGHMEM | __GFP_MOVABLE)) (__GFP_HIGHMEM | __GFP_MOVABLE))
return base + ZONE_MOVABLE; return ZONE_MOVABLE;
#ifdef CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
if (flags & __GFP_HIGHMEM) if (flags & __GFP_HIGHMEM)
return base + ZONE_HIGHMEM; return ZONE_HIGHMEM;
#endif #endif
return base + ZONE_NORMAL; return ZONE_NORMAL;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment