[PATCH] Weaken GFP_THISNODE to not require allocation on the spec node This patch weakens GFP_THISNODE so that an allocation is not required on the indicated node. The memory policy and cpuset constraints are ignored. This means that GFP_THISNODE guarantees to first attempt to allocate on the indicated node and then falls back to other nodes. This is necessary in order to support NUMAQ which has no regular memory on nodes other than node 0. A regular memory allocation can never succeed. The only allocation that can succeed is for HIGHMEM. Index: linux-2.6.18-rc5-mm1/mm/page_alloc.c =================================================================== --- linux-2.6.18-rc5-mm1.orig/mm/page_alloc.c 2006-09-04 09:59:07.382748938 -0700 +++ linux-2.6.18-rc5-mm1/mm/page_alloc.c 2006-09-07 10:49:54.098586314 -0700 @@ -953,9 +953,6 @@ get_page_from_freelist(gfp_t gfp_mask, u */ do { zone = *z; - if (unlikely((gfp_mask & __GFP_THISNODE) && - zone->zone_pgdat != zonelist->zones[0]->zone_pgdat)) - break; if ((alloc_flags & ALLOC_CPUSET) && !cpuset_zone_allowed(zone, gfp_mask)) continue; Index: linux-2.6.18-rc5-mm1/include/linux/gfp.h =================================================================== --- linux-2.6.18-rc5-mm1.orig/include/linux/gfp.h 2006-09-01 10:13:35.614103927 -0700 +++ linux-2.6.18-rc5-mm1/include/linux/gfp.h 2006-09-07 10:51:41.471845070 -0700 @@ -45,7 +45,7 @@ struct vm_area_struct; #define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */ #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ #define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ -#define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ +#define __GFP_THISNODE ((__force gfp_t)0x40000u) /* Bypass cpusets and memory policies */ #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))