public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] lockdep enhancements for bcachefs
@ 2023-11-22 23:51 Kent Overstreet
  2023-11-22 23:51 ` [PATCH 1/6] locking/lockdep: lock_class_is_held() Kent Overstreet
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Kent Overstreet @ 2023-11-22 23:51 UTC (permalink / raw)
  To: linux-kernel, linux-bcachefs, peterz
  Cc: boqun.feng, longman, will, mingo, Kent Overstreet

This adds:
 - lockdep_set_no_check_recursion(), which allows lockdep checking for
   bcachefs six locks

bcachefs has a cycle detector for deadlock avoidance; there is no lock
ordering for lockdep to check w.r.t. other btree node locks. However, we
do want held btree node locks to be tracked, and lock ordering to be
checked w.r.t. other locks.

 - lock_class_is_held(), which we use for some extra locking assertion

We want to assert e.g. that we're not blocking on IO with btree node
locks held.

Kent Overstreet (6):
  locking/lockdep: lock_class_is_held()
  locking/lockdep: lockdep_set_no_check_recursion()
  bcachefs: Assert that btree node locks aren't being leaked
  bcachefs: Use lock_class_is_held() for btree locking asserts
  bcachefs: Check for btree locks held on transaction init
  bcachefs: Switch to lockdep_set_no_check_recursion()

 fs/bcachefs/btree_gc.c        |  3 +++
 fs/bcachefs/btree_iter.c      |  2 ++
 fs/bcachefs/btree_locking.c   | 14 ++++++++---
 fs/bcachefs/btree_types.h     |  1 +
 include/linux/lockdep.h       | 10 ++++++++
 include/linux/lockdep_types.h |  2 +-
 kernel/locking/lockdep.c      | 46 +++++++++++++++++++++++++++++++++++
 7 files changed, 73 insertions(+), 5 deletions(-)

-- 
2.42.0


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

end of thread, other threads:[~2023-11-24 23:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-22 23:51 [PATCH 0/6] lockdep enhancements for bcachefs Kent Overstreet
2023-11-22 23:51 ` [PATCH 1/6] locking/lockdep: lock_class_is_held() Kent Overstreet
2023-11-22 23:51 ` [PATCH 2/6] locking/lockdep: lockdep_set_no_check_recursion() Kent Overstreet
2023-11-24  9:58   ` Peter Zijlstra
2023-11-24 23:29     ` Kent Overstreet
2023-11-22 23:51 ` [PATCH 3/6] bcachefs: Assert that btree node locks aren't being leaked Kent Overstreet
2023-11-22 23:51 ` [PATCH 4/6] bcachefs: Use lock_class_is_held() for btree locking asserts Kent Overstreet
2023-11-22 23:51 ` [PATCH 5/6] bcachefs: Check for btree locks held on transaction init Kent Overstreet
2023-11-22 23:51 ` [PATCH 6/6] bcachefs: Switch to lockdep_set_no_check_recursion() Kent Overstreet

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