Re: [PATCH] mm/kmemleak: allow __GFP_NOLOCKDEP passed to kmemleak's gfp

From: Catalin Marinas
Date: Tue Sep 07 2021 - 03:24:01 EST


On Tue, Sep 07, 2021 at 02:56:59PM +0900, Naohiro Aota wrote:
> In a memory pressure situation, I'm seeing the lockdep WARNING below.
> Actually, this is similar to a known false positive which is already
> addressed by commit 6dcde60efd94 ("xfs: more lockdep whackamole with
> kmem_alloc*").
>
> This warning still persists because it's not from kmalloc() itself but
> from an allocation for kmemleak object. While kmalloc() itself suppress
> the warning with __GFP_NOLOCKDEP, gfp_kmemleak_mask() is dropping the
> flag for the kmemleak's allocation.
>
> Allow __GFP_NOLOCKDEP to be passed to kmemleak's allocation, so that the
> warning for it is also suppressed.
>
> ======================================================
> WARNING: possible circular locking dependency detected
> 5.14.0-rc7-BTRFS-ZNS+ #37 Not tainted

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