mm: postpone the disabling of kmemleak early logging
authorCatalin Marinas <catalin.marinas@arm.com>
Fri, 9 May 2014 22:36:59 +0000 (15:36 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 11 May 2014 08:55:48 +0000 (17:55 +0900)
commit3551a9280bcb728980a13783ff295e9f0bdedd9a
tree6993600a8b65e4d03db299162095cf205575af75
parentf2eb7f6f7a18fc2eff2f74d2bfa12758c0449f12
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>
mm/kmemleak.c