Skip to content

sched, xfs: Add PF_MEMALLOC_NOLOCKDEP to fix lockdep problem in xfs

Waiman Long linux-xfs lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 8 repliesIn review
  2. v12 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- Update patch to add the frozen flag check as the XFS_TRANS_NO_WRITECOUNT check alone is insufficient.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2sched: Add PF_MEMALLOC_NOLOCKDEP flaginclude/linux/sched.h include/linux/sched/mm.h+17 -53 replies
2/2xfs: Fix false positive lockdep warning with sb_internal & fs_reclaimfs/xfs/xfs_log.c fs/xfs/xfs_trans.c+36 -45 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] sched, xfs: Add PF_MEMALLOC_NOLOCKDEP to fix lockdep problem in xfs

v2:
- Update patch to add the frozen flag check as the XFS_TRANS_NO_WRITECOUNT check alone is insufficient.

There is a false positive lockdep warning in how the xfs code handle filesystem freeze:

 Possible unsafe locking scenario:
       CPU0                    CPU1
       ----                    ----
  lock(sb_internal);
                               lock(fs_reclaim);
                               lock(sb_internal);

lock(fs_reclaim);

*** DEADLOCK ***

This patch series works around this problem by adding a PF_MEMALLOC_NOLOCKDEP flag and set during filesystem freeze to avoid the lockdep splat.

Waiman Long (2):
sched: Add PF_MEMALLOC_NOLOCKDEP flag
xfs: Fix false positive lockdep warning with sb_internal & fs_reclaim

 fs/xfs/xfs_log.c         |  9 +++++++++
 fs/xfs/xfs_trans.c       | 31 +++++++++++++++++++++++++++----
 include/linux/sched.h    |  7 +++++++
 include/linux/sched/mm.h | 15 ++++++++++-----
 4 files changed, 53 insertions(+), 9 deletions(-)
Signature · 1 line
2.18.1