[PATCH] Remove alloc_pages() use from slab allocator

From: Christoph Lameter
Date: Thu Nov 10 2005 - 16:50:01 EST


The slab allocator never uses alloc_pages since kmem_getpages() is always
called with a valid nodeid. Remove the branch and the code from kmem_getpages()

Signed-off-by: Christoph Lameter <clameter@xxxxxxx>

Index: linux-2.6.14-mm1/mm/slab.c
===================================================================
--- linux-2.6.14-mm1.orig/mm/slab.c 2005-11-10 11:06:34.000000000 -0800
+++ linux-2.6.14-mm1/mm/slab.c 2005-11-10 11:41:15.000000000 -0800
@@ -1193,11 +1194,7 @@ static void *kmem_getpages(kmem_cache_t
int i;

flags |= cachep->gfpflags;
- if (likely(nodeid == -1)) {
- page = alloc_pages(flags, cachep->gfporder);
- } else {
- page = alloc_pages_node(nodeid, flags, cachep->gfporder);
- }
+ page = alloc_pages_node(nodeid, flags, cachep->gfporder);
if (!page)
return NULL;
addr = page_address(page);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/