From: Matthew Wilcox <matthew@wil.cx>

__get_free_pages() calls alloc_pages, finds the page_address() and throws
away the struct page *.  Slab then calls virt_to_page to get it back again.
 Much more efficient for slab to call alloc_pages itself, as well as making
the NUMA and non-NUMA cases more similarr to each other.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/mm/slab.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff -puN mm/slab.c~make-slab-use-alloc_pages-directly mm/slab.c
--- 25/mm/slab.c~make-slab-use-alloc_pages-directly	Mon Jan 24 14:36:50 2005
+++ 25-akpm/mm/slab.c	Mon Jan 24 14:36:50 2005
@@ -896,16 +896,13 @@ static void *kmem_getpages(kmem_cache_t 
 
 	flags |= cachep->gfpflags;
 	if (likely(nodeid == -1)) {
-		addr = (void*)__get_free_pages(flags, cachep->gfporder);
-		if (!addr)
-			return NULL;
-		page = virt_to_page(addr);
+		page = alloc_pages(flags, cachep->gfporder);
 	} else {
 		page = alloc_pages_node(nodeid, flags, cachep->gfporder);
-		if (!page)
-			return NULL;
-		addr = page_address(page);
 	}
+	if (!page)
+		return NULL;
+	addr = page_address(page);
 
 	i = (1 << cachep->gfporder);
 	if (cachep->flags & SLAB_RECLAIM_ACCOUNT)
_