linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] slqb: add common slab debug bits
@ 2009-08-31  7:42 Wu Fengguang
  2009-09-03 19:40 ` Pekka Enberg
  0 siblings, 1 reply; 2+ messages in thread
From: Wu Fengguang @ 2009-08-31  7:42 UTC (permalink / raw)
  To: Andrew Morton
  Cc: KOSAKI Motohiro, linux-kernel@vger.kernel.org, Nick Piggin,
	Christoph Lameter, linux-mm

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

- lockdep annotation
- might sleep annotation
- fault injection

CC: Nick Piggin <nickpiggin@yahoo.com.au>
CC: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
 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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-03 19:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-31  7:42 [PATCH] slqb: add common slab debug bits Wu Fengguang
2009-09-03 19:40 ` Pekka Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).