Commit ee421bb5 authored by Wu Fengguang's avatar Wu Fengguang Committed by Pekka Enberg

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: default avatarWu Fengguang <fengguang.wu@intel.com>
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
parent ff61c495
......@@ -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(struct kmem_cache *s,
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment