[patch 4/6] SLUB: Avoid touching page struct when freeing to per cpu slab
From: Christoph Lameter <hidden>
Date: 2007-08-23 06:48:04
Also in:
lkml
Set c->node to -1 if we allocate from a debug slab instead for SlabDebug which requires access the page struct cacheline. Signed-off-by: Christoph Lameter <redacted> --- mm/slub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Index: linux-2.6.23-rc3-mm1/mm/slub.c ===================================================================
--- linux-2.6.23-rc3-mm1.orig/mm/slub.c 2007-08-22 17:20:28.000000000 -0700
+++ linux-2.6.23-rc3-mm1/mm/slub.c 2007-08-22 17:20:33.000000000 -0700@@ -1517,6 +1517,7 @@ debug: c->page->inuse++; c->page->freelist = object[c->offset]; + c->node = -1; slab_unlock(c->page); return object; }
@@ -1540,8 +1541,7 @@ static void __always_inline *slab_alloc( local_irq_save(flags); c = get_cpu_slab(s, smp_processor_id()); - if (unlikely(!c->page || !c->freelist || - !node_match(c, node))) + if (unlikely(!c->freelist || !node_match(c, node))) object = __slab_alloc(s, gfpflags, node, addr, c);
@@ -1650,7 +1650,7 @@ static void __always_inline slab_free(st local_irq_save(flags); debug_check_no_locks_freed(object, s->objsize); c = get_cpu_slab(s, smp_processor_id()); - if (likely(page == c->page && !SlabDebug(page))) { + if (likely(page == c->page && c->node >= 0)) { object[c->offset] = c->freelist; c->freelist = object; } else
--