• Naohiro Aota's avatar
    mm/kmemleak: allow __GFP_NOLOCKDEP passed to kmemleak's gfp · 79d37050
    Naohiro Aota authored
    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 6dcde60e ("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
      ------------------------------------------------------
      kswapd0/288 is trying to acquire lock:
      ffff88825ab45df0 (&xfs_nondir_ilock_class){++++}-{3:3}, at: xfs_ilock+0x8a/0x250
    
      but task is already holding lock:
      ff...
    79d37050
kmemleak.c 56.5 KB