aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2011-07-07 14:36:37 -0400
committerPekka Enberg <penberg@kernel.org>2011-07-07 15:17:08 -0400
commitd18a90dd85f8243ed20cdadb6d8a37d595df456d (patch)
tree35830bc434bfdb18605ff493b0a1406c3dcf8ac0 /include/linux
parentd6543e3935cec9f66b9647c24c2e44c68f8a91fd (diff)
slub: Add method to verify memory is not freed
This is for tracking down suspect memory usage. Acked-by: Christoph Lameter <cl@linux.com> Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/slub_def.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index fd4fdc72bc8c..4b35c06dfbc5 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -218,6 +218,19 @@ kmalloc_order(size_t size, gfp_t flags, unsigned int order)
218 return ret; 218 return ret;
219} 219}
220 220
221/**
222 * Calling this on allocated memory will check that the memory
223 * is expected to be in use, and print warnings if not.
224 */
225#ifdef CONFIG_SLUB_DEBUG
226extern bool verify_mem_not_deleted(const void *x);
227#else
228static inline bool verify_mem_not_deleted(const void *x)
229{
230 return true;
231}
232#endif
233
221#ifdef CONFIG_TRACING 234#ifdef CONFIG_TRACING
222extern void * 235extern void *
223kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size); 236kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size);