public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] sched, xfs: Add PF_MEMALLOC_NOLOCKDEP to fix lockdep problem in xfs
@ 2020-06-17 17:53 Waiman Long
  2020-06-17 17:53 ` [PATCH v2 1/2] sched: Add PF_MEMALLOC_NOLOCKDEP flag Waiman Long
  2020-06-17 17:53 ` [PATCH v2 2/2] xfs: Fix false positive lockdep warning with sb_internal & fs_reclaim Waiman Long
  0 siblings, 2 replies; 11+ messages in thread
From: Waiman Long @ 2020-06-17 17:53 UTC (permalink / raw)
  To: Darrick J. Wong, Ingo Molnar, Peter Zijlstra, Juri Lelli,
	Vincent Guittot
  Cc: linux-xfs, linux-kernel, Dave Chinner, Qian Cai, Eric Sandeen,
	Andrew Morton, Waiman Long

 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(-)

-- 
2.18.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-06-22 19:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-17 17:53 [PATCH v2 0/2] sched, xfs: Add PF_MEMALLOC_NOLOCKDEP to fix lockdep problem in xfs Waiman Long
2020-06-17 17:53 ` [PATCH v2 1/2] sched: Add PF_MEMALLOC_NOLOCKDEP flag Waiman Long
2020-06-18  0:01   ` Dave Chinner
2020-06-18  1:32     ` Waiman Long
2020-06-22 19:16     ` Peter Zijlstra
2020-06-17 17:53 ` [PATCH v2 2/2] xfs: Fix false positive lockdep warning with sb_internal & fs_reclaim Waiman Long
2020-06-18  0:45   ` Dave Chinner
2020-06-18  1:35     ` Waiman Long
2020-06-18  1:36     ` Darrick J. Wong
2020-06-19 13:21   ` Christoph Hellwig
2020-06-19 15:08     ` Waiman Long

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox