提交 d6fef9da 编写于 作者: L Luke Yang 提交者: Linus Torvalds

[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: NLuke Yang <luke.adi@gmail.com>
Acked-by: NNick Piggin <npiggin@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 fb7faf33
......@@ -1456,7 +1456,14 @@ static void *kmem_getpages(struct kmem_cache *cachep, gfp_t flags, int nodeid)
int i;
flags |= cachep->gfpflags;
#ifndef CONFIG_MMU
/* nommu uses slab's for process anonymous memory allocations, so
* requires __GFP_COMP to properly refcount higher order allocations"
*/
page = alloc_pages_node(nodeid, (flags | __GFP_COMP), cachep->gfporder);
#else
page = alloc_pages_node(nodeid, flags, cachep->gfporder);
#endif
if (!page)
return NULL;
addr = page_address(page);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册