aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab.c
diff options
context:
space:
mode:
authorLuke Yang <luke.adi@gmail.com>2006-04-11 01:52:56 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-11 09:18:32 -0400
commitd6fef9da19b7acd46e04b7dbbba726b3febeca94 (patch)
treebcbacfc4edc18a6c3e266717f3928ff9c5167002 /mm/slab.c
parentfb7faf3313d527bf68ba2e7ff3a2b6ebf201af73 (diff)
[PATCH] nommu: use compound page in slab allocator
The earlier patch to consolidate mmu and nommu page allocation and refcounting by using compound pages for nommu allocations had a bug: kmalloc slabs who's pages were initially allocated by a non-__GFP_COMP allocator could be passed into mm/nommu.c kmalloc allocations which really wanted __GFP_COMP underlying pages. Fix that by having nommu pass __GFP_COMP to all higher order slab allocations. Signed-off-by: Luke Yang <luke.adi@gmail.com> Acked-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/slab.c')
-rw-r--r--mm/slab.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 752c5570f2f6..e6ef9bd52335 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1456,7 +1456,14 @@ static void *kmem_getpages(struct kmem_cache *cachep, gfp_t flags, int nodeid)
1456 int i; 1456 int i;
1457 1457
1458 flags |= cachep->gfpflags; 1458 flags |= cachep->gfpflags;
1459#ifndef CONFIG_MMU
1460 /* nommu uses slab's for process anonymous memory allocations, so
1461 * requires __GFP_COMP to properly refcount higher order allocations"
1462 */
1463 page = alloc_pages_node(nodeid, (flags | __GFP_COMP), cachep->gfporder);
1464#else
1459 page = alloc_pages_node(nodeid, flags, cachep->gfporder); 1465 page = alloc_pages_node(nodeid, flags, cachep->gfporder);
1466#endif
1460 if (!page) 1467 if (!page)
1461 return NULL; 1468 return NULL;
1462 addr = page_address(page); 1469 addr = page_address(page);