Re: "slub: Rework allocator fastpaths" and slub debugging

From: Christoph Lameter
Date: Fri Jul 22 2011 - 10:35:27 EST




Subject: slub: When allocating a new slab also prep the first object

We need to branch to the debug code for the first object if we allocate
a new slab otherwise the first object will be marked wrongly as inactive.

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

---
mm/slub.c | 3 +++
1 file changed, 3 insertions(+)

Index: linux-2.6/mm/slub.c
===================================================================
--- linux-2.6.orig/mm/slub.c 2011-07-22 09:29:05.465576295 -0500
+++ linux-2.6/mm/slub.c 2011-07-22 09:29:55.345575976 -0500
@@ -2082,6 +2082,9 @@ new_slab:
stat(s, ALLOC_SLAB);
c->node = page_to_nid(page);
c->page = page;
+
+ if (kmem_cache_debug(s))
+ goto debug;
goto load_freelist;
}
if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit())
--
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/