2005-11-10 21:50:00

by Christoph Lameter

[permalink] [raw]
Subject: [PATCH] Remove alloc_pages() use from slab allocator

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 <[email protected]>

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);


2005-11-11 11:51:11

by Pekka Enberg

[permalink] [raw]
Subject: Re: [PATCH] Remove alloc_pages() use from slab allocator

Hi Christoph,

On 11/10/05, Christoph Lameter <[email protected]> wrote:
> 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 <[email protected]>

The patch looks good to me.

P.S. Please use the address [email protected] instead when sending me mail.

Pekka