From cd7c0752c89f4d73821e2a7d08743c857c2b8e13 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Sat, 27 Oct 2007 19:32:51 -0700 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 --- mm/slub.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 55b08d0..e094d04 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1493,7 +1493,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: @@ -1541,7 +1543,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)) @@ -1550,8 +1553,7 @@ debug: c->page->inuse++; c->page->freelist = object[c->offset]; c->node = -1; - slab_unlock(c->page); - return object; + goto unlock_out; } /* -- 1.5.3.4