Index: linux-2.6.18-rc2-mm1/mm/mempolicy.c =================================================================== --- linux-2.6.18-rc2-mm1.orig/mm/mempolicy.c 2006-07-15 14:53:08.000000000 -0700 +++ linux-2.6.18-rc2-mm1/mm/mempolicy.c 2006-08-03 14:48:38.868492336 -0700 @@ -1082,6 +1082,21 @@ static struct mempolicy * get_vma_policy return pol; } +static inline int highest_zone(gfp_t gfp) +{ +#ifdef CONFIG_HIGHMEM + if (gfp & __GFP_HIGHMEM) + return ZONE_HIGHMEM; +#endif + if (!(gfp & (__GFP_DMA32 | __GFP_DMA))) + return ZONE_NORMAL; +#ifdef CONFIG_ZONE_DMA32 + if (gfp & __GFP_DMA32) + return ZONE_DMA32; +#endif + return ZONE_DMA; +} + /* Return a zonelist representing a mempolicy */ static struct zonelist *zonelist_policy(gfp_t gfp, struct mempolicy *policy) { @@ -1096,7 +1111,7 @@ static struct zonelist *zonelist_policy( case MPOL_BIND: /* Lower zones don't get a policy applied */ /* Careful: current->mems_allowed might have moved */ - if (gfp_zone(gfp) >= policy_zone) + if (highest_zone(gfp) >= policy_zone) if (cpuset_zonelist_valid_mems_allowed(policy->v.zonelist)) return policy->v.zonelist; /*FALL THROUGH*/