public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] lockdep lock comparison function
@ 2023-02-18  3:21 Kent Overstreet
  2023-02-18  3:21 ` [PATCH 1/2] lockdep: lock_set_lock_cmp_fn() Kent Overstreet
  2023-02-18  3:21 ` [PATCH 2/2] bcache: Convert to lock_cmp_fn Kent Overstreet
  0 siblings, 2 replies; 8+ messages in thread
From: Kent Overstreet @ 2023-02-18  3:21 UTC (permalink / raw)
  To: linux-kernel, peterz; +Cc: Kent Overstreet, mingo, stern

This patch implements the lock comparison function I've been talking
about, and converts one of bcache's locks to use it.

b->write_lock has different locking rules; I'm not sure there's an easy
way to get rid of lockdep_set_novalidate_class for it - but the code has
changed and my memory is foggy. 

I'd like it if we could convert existing uses of *_lock_nested() to this
approach, since it's more rigorous and IMO, much clearer. That'll
require looking at specific use cases, though - the inode lock in
fs/inode.c is the only one I looked at and it's got a lot of nutty stuff
going on.

Kent Overstreet (2):
  lockdep: lock_set_lock_cmp_fn()
  bcache: Convert to lock_cmp_fn

 drivers/md/bcache/btree.c     | 15 ++++++++++-
 drivers/md/bcache/btree.h     |  4 +--
 include/linux/lockdep.h       |  8 ++++++
 include/linux/lockdep_types.h |  6 +++++
 kernel/locking/lockdep.c      | 51 ++++++++++++++++++++++++++++++++++-
 5 files changed, 80 insertions(+), 4 deletions(-)

-- 
2.39.2


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

end of thread, other threads:[~2023-02-23 19:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-18  3:21 [PATCH 0/2] lockdep lock comparison function Kent Overstreet
2023-02-18  3:21 ` [PATCH 1/2] lockdep: lock_set_lock_cmp_fn() Kent Overstreet
2023-02-20 15:09   ` Peter Zijlstra
2023-02-20 22:45     ` Kent Overstreet
2023-02-20 23:51     ` Kent Overstreet
2023-02-23 13:01       ` Peter Zijlstra
2023-02-23 19:27         ` Kent Overstreet
2023-02-18  3:21 ` [PATCH 2/2] bcache: Convert to lock_cmp_fn Kent Overstreet

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