From a94afb4599554cf16335fef8034b0c2bba55833b Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Mon, 7 Jan 2008 23:20:29 -0800 Subject: [PATCH] SLUB: __slab_alloc exit path consolidation Use a single exit path by using goto's to the hottest exit path. Signed-off-by: Christoph Lameter Reviewed-by: Pekka Enberg Signed-off-by: Andrew Morton --- mm/slub.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 71d0cf8..4f3a574 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1494,7 +1494,9 @@ load_freelist: c->page->inuse = s->objects; c->page->freelist = NULL; c->node = page_to_nid(c->page); +unlock_out: slab_unlock(c->page); +out: return object; another_slab: @@ -1524,7 +1526,8 @@ new_slab: c->page = new; goto load_freelist; } - return NULL; + object = NULL; + goto out; debug: object = c->page->freelist; if (!alloc_debug_processing(s, c->page, object, addr)) @@ -1533,8 +1536,7 @@ debug: c->page->inuse++; c->page->freelist = object[c->offset]; c->node = -1; - slab_unlock(c->page); - return object; + goto unlock_out; } /* -- debian.1.5.3.7.1-dirty