diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2014-06-06 17:38:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-06 19:08:17 -0400 |
commit | ce80b067de8cdb44e161a20fd7b324ad3f557446 (patch) | |
tree | 8150a48a821f1cceac55e5325e4c085c692098eb /lib/radix-tree.c | |
parent | ffe2c748e283c5dc1b9b9ac116299dbfc11a609b (diff) |
lib/radix-tree.c: update the kmemleak stack trace for radix tree allocations
Since radix_tree_preload() stack trace is not always useful for
debugging an actual radix tree memory leak, this patch updates the
kmemleak allocation stack trace in the radix_tree_node_alloc() function.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/radix-tree.c')
-rw-r--r-- | lib/radix-tree.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/radix-tree.c b/lib/radix-tree.c index d64815651e90..3291a8e37490 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/radix-tree.h> | 27 | #include <linux/radix-tree.h> |
28 | #include <linux/percpu.h> | 28 | #include <linux/percpu.h> |
29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
30 | #include <linux/kmemleak.h> | ||
30 | #include <linux/notifier.h> | 31 | #include <linux/notifier.h> |
31 | #include <linux/cpu.h> | 32 | #include <linux/cpu.h> |
32 | #include <linux/string.h> | 33 | #include <linux/string.h> |
@@ -200,6 +201,11 @@ radix_tree_node_alloc(struct radix_tree_root *root) | |||
200 | rtp->nodes[rtp->nr - 1] = NULL; | 201 | rtp->nodes[rtp->nr - 1] = NULL; |
201 | rtp->nr--; | 202 | rtp->nr--; |
202 | } | 203 | } |
204 | /* | ||
205 | * Update the allocation stack trace as this is more useful | ||
206 | * for debugging. | ||
207 | */ | ||
208 | kmemleak_update_trace(ret); | ||
203 | } | 209 | } |
204 | if (ret == NULL) | 210 | if (ret == NULL) |
205 | ret = kmem_cache_alloc(radix_tree_node_cachep, gfp_mask); | 211 | ret = kmem_cache_alloc(radix_tree_node_cachep, gfp_mask); |