diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2014-06-06 23:38:19 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-07 01:08:17 +0200 |
commit | 174119628188b085c66fe7d86fbfb4cccb1bd864 (patch) | |
tree | ebb88b086a86f57675a1997ba30593161c11ae7c /mm/mempool.c | |
parent | lib/radix-tree.c: update the kmemleak stack trace for radix tree allocations (diff) | |
download | linux-174119628188b085c66fe7d86fbfb4cccb1bd864.tar.xz linux-174119628188b085c66fe7d86fbfb4cccb1bd864.zip |
mm/mempool.c: update the kmemleak stack trace for mempool allocations
When mempool_alloc() returns an existing pool object, kmemleak_alloc()
is no longer called and the stack trace corresponds to the original
object allocation. This patch updates the kmemleak allocation stack
trace for such objects to make it more useful for debugging.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mempool.c')
-rw-r--r-- | mm/mempool.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/mempool.c b/mm/mempool.c index 455d468c3a5d..e209c98c7203 100644 --- a/mm/mempool.c +++ b/mm/mempool.c @@ -10,6 +10,7 @@ #include <linux/mm.h> #include <linux/slab.h> +#include <linux/kmemleak.h> #include <linux/export.h> #include <linux/mempool.h> #include <linux/blkdev.h> @@ -222,6 +223,11 @@ repeat_alloc: spin_unlock_irqrestore(&pool->lock, flags); /* paired with rmb in mempool_free(), read comment there */ smp_wmb(); + /* + * Update the allocation stack trace as this is more useful + * for debugging. + */ + kmemleak_update_trace(element); return element; } |