Skip to contentSkip to conversation

slqb: add common slab debug bits

PATCH Applied Wu Fengguang 2 participants 2 messages Aug 31, 2009 – Sep 3, 2009 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 slqb: add common slab debug bits

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

- lockdep annotation
- might sleep annotation
- fault injection

CC Nick Piggin <[email protected]>
CC Christoph Lameter <[email protected]>
---
 mm/slqb.c |    7 +++++++
 1 file changed, 7 insertions(+)
mm/slqb.c +7 -0
@@ -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, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

Applied
#1 lore raw
Quoted 9 lines · Wu Fengguang

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

- lockdep annotation
- might sleep annotation
- fault injection

CC Nick Piggin <[email protected]>
CC Christoph Lameter <[email protected]>

Applied, thanks!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>