Re: [PATCH] debugobjects: avoid recursive calls with kmemleak

From: Catalin Marinas
Date: Mon Nov 26 2018 - 12:21:54 EST


On Mon, Nov 26, 2018 at 11:53:43AM -0500, Qian Cai wrote:
> CONFIG_DEBUG_OBJECTS_RCU_HEAD does not play well with kmemleak due to
> recursive calls.
>
> fill_pool
> kmemleak_ignore
> make_black_object
> put_object
> __call_rcu (kernel/rcu/tree.c)
> debug_rcu_head_queue
> debug_object_activate
> debug_object_init
> fill_pool
> kmemleak_ignore
> make_black_object
> ...
>
> Hence, adding SLAB_NOLEAKTRACE to kmem_cache_create() to not register a
> newly allocated debug objects at all.
>
> Suggested-by: Catalin Marinas <catalin.marinas@xxxxxxx>
> Signed-off-by: Qian Cai <cai@xxxxxx>

Acked-by: Catalin Marinas <catalin.marinas@xxxxxxx>