mm: page_alloc: increase __GFP_BITS_SHIFT to include __GFP_OTHER_NODE
authorJohannes Weiner <[email protected]>
Wed, 3 Aug 2011 23:21:09 +0000 (16:21 -0700)
committerLinus Torvalds <[email protected]>
Thu, 4 Aug 2011 00:25:21 +0000 (14:25 -1000)
__GFP_OTHER_NODE is used for NUMA allocations on behalf of other nodes.
It's supposed to be passed through from the page allocator to
zone_statistics(), but it never gets there as gfp_allowed_mask is not
wide enough and masks out the flag early in the allocation path.

The result is an accounting glitch where successful NUMA allocations
by-agent are not properly attributed as local.

Increase __GFP_BITS_SHIFT so that it includes __GFP_OTHER_NODE.

Signed-off-by: Johannes Weiner <[email protected]>
Acked-by: Andi Kleen <[email protected]>
Reviewed-by: Minchan Kim <[email protected]>
Acked-by: Mel Gorman <[email protected]>
Reviewed-by: Michal Hocko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/gfp.h

index cb4089254f01feb22fa7db68841f81e7e6b2569c..3a76faf6a3ee82cd20f82d36208c6f50c8f29685 100644 (file)
@@ -92,7 +92,7 @@ struct vm_area_struct;
  */
 #define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK)
 
-#define __GFP_BITS_SHIFT 23    /* Room for 23 __GFP_FOO bits */
+#define __GFP_BITS_SHIFT 24    /* Room for N __GFP_FOO bits */
 #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
 
 /* This equals 0, but use constants in case they ever change */