summaryrefslogtreecommitdiffstats
path: root/mm/kmemleak.c
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-01-12 16:53:10 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2018-01-13 10:42:48 -0800
commitd9570ee3bd1d4f20ce63485f5ef05663866fe6c0 (patch)
treea625ced48ca7ceaeafb4e1683ab597107a3a5d54 /mm/kmemleak.c
parentbed6760cf2c40778a58f2e399c8947b3b3c55518 (diff)
downloadlinux-stable-d9570ee3bd1d4f20ce63485f5ef05663866fe6c0.tar.gz
linux-stable-d9570ee3bd1d4f20ce63485f5ef05663866fe6c0.tar.bz2
linux-stable-d9570ee3bd1d4f20ce63485f5ef05663866fe6c0.zip
kmemleak: allow to coexist with fault injection
kmemleak does one slab allocation per user allocation. So if slab fault injection is enabled to any degree, kmemleak instantly fails to allocate and turns itself off. However, it's useful to use kmemleak with fault injection to find leaks on error paths. On the other hand, checking kmemleak itself is not so useful because (1) it's a debugging tool and (2) it has a very regular allocation pattern (basically a single allocation site, so it either works or not). Turn off fault injection for kmemleak allocations. Link: http://lkml.kernel.org/r/20180109192243.19316-1-dvyukov@google.com Signed-off-by: Dmitry Vyukov <dvyukov@google.com> Cc: 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/kmemleak.c')
-rw-r--r--mm/kmemleak.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index d73c14294f3a..f656ca27f6c2 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -127,7 +127,7 @@
/* GFP bitmask for kmemleak internal allocations */
#define gfp_kmemleak_mask(gfp) (((gfp) & (GFP_KERNEL | GFP_ATOMIC)) | \
__GFP_NORETRY | __GFP_NOMEMALLOC | \
- __GFP_NOWARN)
+ __GFP_NOWARN | __GFP_NOFAIL)
/* scanning area inside a memory block */
struct kmemleak_scan_area {