[PATCH] slqb: add common slab debug bits

From: Wu Fengguang
Date: Mon Aug 31 2009 - 03:42:39 EST


This is a simple copy&paste from slub.c:

- lockdep annotation
- might sleep annotation
- fault injection

CC: Nick Piggin <nickpiggin@xxxxxxxxxxxx>
CC: Christoph Lameter <cl@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Wu Fengguang <fengguang.wu@xxxxxxxxx>
---
mm/slqb.c | 7 +++++++
1 file changed, 7 insertions(+)

--- linux-mm.orig/mm/slqb.c 2009-08-28 15:51:15.000000000 +0800
+++ linux-mm/mm/slqb.c 2009-08-28 16:05:33.000000000 +0800
@@ -19,6 +19,7 @@
#include <linux/ctype.h>
#include <linux/kallsyms.h>
#include <linux/memory.h>
+#include <linux/fault-inject.h>

/*
* TODO
@@ -1541,6 +1542,12 @@ static __always_inline void *slab_alloc(

gfpflags &= gfp_allowed_mask;

+ lockdep_trace_alloc(gfpflags);
+ might_sleep_if(gfpflags & __GFP_WAIT);
+
+ if (should_failslab(s->objsize, gfpflags))
+ return NULL;
+
again:
local_irq_save(flags);
object = __slab_alloc(s, gfpflags, node);
--
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/