diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2014-05-09 18:36:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-05-11 04:55:48 -0400 |
commit | 3551a9280bcb728980a13783ff295e9f0bdedd9a (patch) | |
tree | 6993600a8b65e4d03db299162095cf205575af75 /mm | |
parent | f2eb7f6f7a18fc2eff2f74d2bfa12758c0449f12 (diff) |
mm: postpone the disabling of kmemleak early logging
Commit 8910ae896c8c ("kmemleak: change some global variables to int"),
in addition to the atomic -> int conversion, moved the disabling of
kmemleak_early_log to the beginning of the kmemleak_init() function,
before the full kmemleak tracing is actually enabled. In this small
window, kmem_cache_create() is called by kmemleak which triggers
additional memory allocation that are not traced. This patch restores
the original logic with kmemleak_early_log disabling when kmemleak is
fully functional.
Fixes: 8910ae896c8c (kmemleak: change some global variables to int)
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: Li Zefan <lizefan@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/kmemleak.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 91d67eaee050..8d2fcdfeff7f 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c | |||
@@ -1775,10 +1775,9 @@ void __init kmemleak_init(void) | |||
1775 | int i; | 1775 | int i; |
1776 | unsigned long flags; | 1776 | unsigned long flags; |
1777 | 1777 | ||
1778 | kmemleak_early_log = 0; | ||
1779 | |||
1780 | #ifdef CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF | 1778 | #ifdef CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF |
1781 | if (!kmemleak_skip_disable) { | 1779 | if (!kmemleak_skip_disable) { |
1780 | kmemleak_early_log = 0; | ||
1782 | kmemleak_disable(); | 1781 | kmemleak_disable(); |
1783 | return; | 1782 | return; |
1784 | } | 1783 | } |
@@ -1796,6 +1795,7 @@ void __init kmemleak_init(void) | |||
1796 | 1795 | ||
1797 | /* the kernel is still in UP mode, so disabling the IRQs is enough */ | 1796 | /* the kernel is still in UP mode, so disabling the IRQs is enough */ |
1798 | local_irq_save(flags); | 1797 | local_irq_save(flags); |
1798 | kmemleak_early_log = 0; | ||
1799 | if (kmemleak_error) { | 1799 | if (kmemleak_error) { |
1800 | local_irq_restore(flags); | 1800 | local_irq_restore(flags); |
1801 | return; | 1801 | return; |