From 6d989271a9a5da6cb50a91259b0e82e598f77d0b Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Fri, 3 Aug 2007 15:42:39 -0700 Subject: [PATCH] Get rid of GFP_LEVEL_MASK Use the newly added _MASKS at the existing callsites. Signed-off-by: Christoph Lameter --- include/linux/gfp.h | 1 + mm/slab.c | 7 +++++-- mm/slub.c | 8 ++++++-- mm/vmalloc.c | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) Index: linux-2.6.23-rc1-mm2/include/linux/gfp.h =================================================================== --- linux-2.6.23-rc1-mm2.orig/include/linux/gfp.h 2007-08-03 16:40:52.000000000 -0700 +++ linux-2.6.23-rc1-mm2/include/linux/gfp.h 2007-08-03 16:41:07.000000000 -0700 @@ -95,6 +95,7 @@ struct vm_area_struct; /* Flags that control allocation constraints */ #define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE) +#define GFP_SLAB_IGNORE_MASK (__GFP_COLD|__GFP_COMP|__GFP_MOVABLE) /* * Traditional mask to use for passing through page allocator flags * through a derived allocator. Index: linux-2.6.23-rc1-mm2/mm/slab.c =================================================================== --- linux-2.6.23-rc1-mm2.orig/mm/slab.c 2007-08-03 16:35:11.000000000 -0700 +++ linux-2.6.23-rc1-mm2/mm/slab.c 2007-08-03 16:41:07.000000000 -0700 @@ -2768,9 +2768,12 @@ static int cache_grow(struct kmem_cache * Be lazy and only check for valid flags here, keeping it out of the * critical path in kmem_cache_alloc(). */ - BUG_ON(flags & ~(GFP_DMA | __GFP_ZERO | GFP_LEVEL_MASK)); + BUG_ON(flags & ~(GFP_DMA | __GFP_ZERO | + GFP_RECLAIM_MASK | + GFP_CONSTRAINT_MASK | + GFP_SLAB_IGNORE_MASK)); - local_flags = (flags & GFP_LEVEL_MASK); + local_flags = (flags & (GFP_CONSTRAINT_MASK|GFP_RECLAIM_MASK)); /* Take the l3 list lock to change the colour_next on this node */ check_irq_off(); l3 = cachep->nodelists[nodeid]; Index: linux-2.6.23-rc1-mm2/mm/slub.c =================================================================== --- linux-2.6.23-rc1-mm2.orig/mm/slub.c 2007-08-03 16:35:14.000000000 -0700 +++ linux-2.6.23-rc1-mm2/mm/slub.c 2007-08-03 16:41:07.000000000 -0700 @@ -1088,12 +1088,16 @@ static struct page *new_slab(struct kmem void *last; void *p; - BUG_ON(flags & ~(GFP_DMA | __GFP_ZERO | GFP_LEVEL_MASK)); + BUG_ON(flags & ~(GFP_DMA | __GFP_ZERO | + GFP_CONSTRAINT_MASK | + GFP_RECLAIM_MASK| + GFP_SLAB_IGNORE_MASK)); if (flags & __GFP_WAIT) local_irq_enable(); - page = allocate_slab(s, flags & GFP_LEVEL_MASK, node); + page = allocate_slab(s, + flags & (GFP_RECLAIM_MASK|GFP_CONSTRAINT_MASK), node); if (!page) goto out; Index: linux-2.6.23-rc1-mm2/mm/vmalloc.c =================================================================== --- linux-2.6.23-rc1-mm2.orig/mm/vmalloc.c 2007-07-22 13:41:00.000000000 -0700 +++ linux-2.6.23-rc1-mm2/mm/vmalloc.c 2007-08-03 16:41:07.000000000 -0700 @@ -190,7 +190,7 @@ static struct vm_struct *__get_vm_area_n if (unlikely(!size)) return NULL; - area = kmalloc_node(sizeof(*area), gfp_mask & GFP_LEVEL_MASK, node); + area = kmalloc_node(sizeof(*area), gfp_mask & GFP_RECLAIM_MASK, node); if (unlikely(!area)) return NULL;