Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit d9570ee

Browse files
dvyukovtorvalds
authored andcommitted
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>
1 parent bed6760 commit d9570ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/kmemleak.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
/* GFP bitmask for kmemleak internal allocations */
128128
#define gfp_kmemleak_mask(gfp) (((gfp) & (GFP_KERNEL | GFP_ATOMIC)) | \
129129
__GFP_NORETRY | __GFP_NOMEMALLOC | \
130-
__GFP_NOWARN)
130+
__GFP_NOWARN | __GFP_NOFAIL)
131131

132132
/* scanning area inside a memory block */
133133
struct kmemleak_scan_area {

0 commit comments

Comments
 (0)