aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2014-06-06 17:38:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-06 19:08:17 -0400
commit174119628188b085c66fe7d86fbfb4cccb1bd864 (patch)
treeebb88b086a86f57675a1997ba30593161c11ae7c /mm
parentce80b067de8cdb44e161a20fd7b324ad3f557446 (diff)
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')
-rw-r--r--mm/mempool.c6
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 @@
10 10
11#include <linux/mm.h> 11#include <linux/mm.h>
12#include <linux/slab.h> 12#include <linux/slab.h>
13#include <linux/kmemleak.h>
13#include <linux/export.h> 14#include <linux/export.h>
14#include <linux/mempool.h> 15#include <linux/mempool.h>
15#include <linux/blkdev.h> 16#include <linux/blkdev.h>
@@ -222,6 +223,11 @@ repeat_alloc:
222 spin_unlock_irqrestore(&pool->lock, flags); 223 spin_unlock_irqrestore(&pool->lock, flags);
223 /* paired with rmb in mempool_free(), read comment there */ 224 /* paired with rmb in mempool_free(), read comment there */
224 smp_wmb(); 225 smp_wmb();
226 /*
227 * Update the allocation stack trace as this is more useful
228 * for debugging.
229 */
230 kmemleak_update_trace(element);
225 return element; 231 return element;
226 } 232 }
227 233