From 4ef1e0def45a785780990800e33258ad622b204c 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 6faffaf..6c94970 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1491,7 +1491,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: @@ -1521,7 +1523,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)) @@ -1530,8 +1533,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.6