[slubllv7 13/17] slub: Get rid of the another_slab label

From: Christoph Lameter
Date: Wed Jun 01 2011 - 13:27:54 EST


We can avoid deactivate slab in special cases if we do the
deactivation of slabs in each code flow that leads to new_slab.

Signed-off-by: Christoph Lameter <cl@xxxxxxxxx>

---
mm/slub.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)

Index: linux-2.6/mm/slub.c
===================================================================
--- linux-2.6.orig/mm/slub.c 2011-05-31 14:27:11.362880110 -0500
+++ linux-2.6/mm/slub.c 2011-05-31 14:27:12.002880106 -0500
@@ -1965,8 +1965,10 @@ static void *__slab_alloc(struct kmem_ca
if (!page)
goto new_slab;

- if (unlikely(!node_match(c, node)))
- goto another_slab;
+ if (unlikely(!node_match(c, node))) {
+ deactivate_slab(s, c);
+ goto new_slab;
+ }

stat(s, ALLOC_SLOWPATH);

@@ -1986,7 +1988,7 @@ load_freelist:
VM_BUG_ON(!page->frozen);

if (unlikely(!object))
- goto another_slab;
+ goto new_slab;

stat(s, ALLOC_REFILL);

@@ -1995,9 +1997,6 @@ load_freelist:
local_irq_restore(flags);
return object;

-another_slab:
- deactivate_slab(s, c);
-
new_slab:
page = get_partial(s, gfpflags, node);
if (page) {

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/