mm: postpone the disabling of kmemleak early logging
Commit8910ae896c
("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:8910ae896c
(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>
This commit is contained in:
parent
f2eb7f6f7a
commit
3551a9280b
|
@ -1775,10 +1775,9 @@ void __init kmemleak_init(void)
|
||||||
int i;
|
int i;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
kmemleak_early_log = 0;
|
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF
|
#ifdef CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF
|
||||||
if (!kmemleak_skip_disable) {
|
if (!kmemleak_skip_disable) {
|
||||||
|
kmemleak_early_log = 0;
|
||||||
kmemleak_disable();
|
kmemleak_disable();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1796,6 +1795,7 @@ void __init kmemleak_init(void)
|
||||||
|
|
||||||
/* the kernel is still in UP mode, so disabling the IRQs is enough */
|
/* the kernel is still in UP mode, so disabling the IRQs is enough */
|
||||||
local_irq_save(flags);
|
local_irq_save(flags);
|
||||||
|
kmemleak_early_log = 0;
|
||||||
if (kmemleak_error) {
|
if (kmemleak_error) {
|
||||||
local_irq_restore(flags);
|
local_irq_restore(flags);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue