From: Catalin Marinas Date: Fri, 6 Jun 2014 21:38:19 +0000 (-0700) Subject: mm/mempool.c: update the kmemleak stack trace for mempool allocations X-Git-Tag: v4.9.8~6305^2~4^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=174119628188b085c66fe7d86fbfb4cccb1bd864;p=platform%2Fkernel%2Flinux-rpi3.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/mempool.c b/mm/mempool.c index 455d468..e209c98 100644 --- a/mm/mempool.c +++ b/mm/mempool.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -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; }