Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

slab: add a flag to prevent debug_free checks on a kmem_cache

This is a preperatory patch for the debugobjects infrastructure. The flag
prevents debug_free checks on kmem_caches. This is necessary to avoid
resursive calls into a debug mechanism which uses a kmem_cache itself.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Thomas Gleixner and committed by
Linus Torvalds
30327acf 145980a0

+7
+7
include/linux/slab.h
··· 29 29 #define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ 30 30 #define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */ 31 31 32 + /* Flag to prevent checks on free */ 33 + #ifdef CONFIG_DEBUG_OBJECTS 34 + # define SLAB_DEBUG_OBJECTS 0x00400000UL 35 + #else 36 + # define SLAB_DEBUG_OBJECTS 0x00000000UL 37 + #endif 38 + 32 39 /* The following flags affect the page allocator grouping pages by mobility */ 33 40 #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ 34 41 #define SLAB_TEMPORARY SLAB_RECLAIM_ACCOUNT /* Objects are short-lived */