aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kmemleak.h
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2011-09-26 12:12:53 -0400
committerCatalin Marinas <catalin.marinas@arm.com>2011-12-02 11:12:42 -0500
commitf528f0b8e53d73b18be71e96693cfab9322f33c7 (patch)
tree5a25d6ac1c2f18561e554074aa7c06bf3d899183 /include/linux/kmemleak.h
parent74341703edca6bc68a165a18453071b097828407 (diff)
kmemleak: Handle percpu memory allocation
This patch adds kmemleak callbacks from the percpu allocator, reducing a number of false positives caused by kmemleak not scanning such memory blocks. The percpu chunks are never reported as leaks because of current kmemleak limitations with the __percpu pointer not pointing directly to the actual chunks. Reported-by: Huajun Li <huajun.li.lee@gmail.com> Acked-by: Christoph Lameter <cl@gentwo.org> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'include/linux/kmemleak.h')
-rw-r--r--include/linux/kmemleak.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/kmemleak.h b/include/linux/kmemleak.h
index 99d9a6766f7..2a5e5548a1d 100644
--- a/include/linux/kmemleak.h
+++ b/include/linux/kmemleak.h
@@ -26,8 +26,10 @@
26extern void kmemleak_init(void) __ref; 26extern void kmemleak_init(void) __ref;
27extern void kmemleak_alloc(const void *ptr, size_t size, int min_count, 27extern void kmemleak_alloc(const void *ptr, size_t size, int min_count,
28 gfp_t gfp) __ref; 28 gfp_t gfp) __ref;
29extern void kmemleak_alloc_percpu(const void __percpu *ptr, size_t size) __ref;
29extern void kmemleak_free(const void *ptr) __ref; 30extern void kmemleak_free(const void *ptr) __ref;
30extern void kmemleak_free_part(const void *ptr, size_t size) __ref; 31extern void kmemleak_free_part(const void *ptr, size_t size) __ref;
32extern void kmemleak_free_percpu(const void __percpu *ptr) __ref;
31extern void kmemleak_padding(const void *ptr, unsigned long offset, 33extern void kmemleak_padding(const void *ptr, unsigned long offset,
32 size_t size) __ref; 34 size_t size) __ref;
33extern void kmemleak_not_leak(const void *ptr) __ref; 35extern void kmemleak_not_leak(const void *ptr) __ref;
@@ -68,6 +70,9 @@ static inline void kmemleak_alloc_recursive(const void *ptr, size_t size,
68 gfp_t gfp) 70 gfp_t gfp)
69{ 71{
70} 72}
73static inline void kmemleak_alloc_percpu(const void __percpu *ptr, size_t size)
74{
75}
71static inline void kmemleak_free(const void *ptr) 76static inline void kmemleak_free(const void *ptr)
72{ 77{
73} 78}
@@ -77,6 +82,9 @@ static inline void kmemleak_free_part(const void *ptr, size_t size)
77static inline void kmemleak_free_recursive(const void *ptr, unsigned long flags) 82static inline void kmemleak_free_recursive(const void *ptr, unsigned long flags)
78{ 83{
79} 84}
85static inline void kmemleak_free_percpu(const void __percpu *ptr)
86{
87}
80static inline void kmemleak_not_leak(const void *ptr) 88static inline void kmemleak_not_leak(const void *ptr)
81{ 89{
82} 90}