lkml.org 
[lkml]   [2009]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 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 <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);

\
 
 \ /
  Last update: 2009-08-31 09:45    [W:0.028 / U:16.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site