mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* lockdep pinning
@ 2026-02-26 22:01 Liam R. Howlett
  2026-02-27 13:40 ` Peter Zijlstra
  0 siblings, 1 reply; 3+ messages in thread
From: Liam R. Howlett @ 2026-02-26 22:01 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Will Deacon, Boqun Feng, Waiman Long
  Cc: linux-kernel, Paul E . McKenney 

Hello,

I'm trying to detect locking issues in the maple tree, which is severely
complicated by allowing external locks.  I have an rcu lock validation
using the get_state_synchronize_rcu() and poll_state_synchronize_rcu()
interface working and would like something like this for write locks.

The issue is that, with external locks, the code that does the unlocking
is outside my scope.  Although I can detect a start of an operation and
pin a lock using the existing lockdep_pin_lock() function, I do not know
when the lock is 'done' as it can be used for multiple operations on the
tree.

So I'd either be unpinning too early and be unable to tell if it was
unlocked/relocked, or I'd leave it pinned forever - which will trigger a
warning on release.

What I'm looking for is a way to ensure my code is still in the same
lock context, but not unpin/pin.  Maybe something like storing a lock
cookie id in the lock every time it's locked (just overwrite would be
fine), and a way to read that value.  Then I can validate the value
against the one I've stored.

AFAICT, I cannot accomplish what I want with the existing lockdep
implementation?

Thanks,
Liam


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

end of thread, other threads:[~2026-02-27 16:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-26 22:01 lockdep pinning Liam R. Howlett
2026-02-27 13:40 ` Peter Zijlstra
2026-02-27 16:35   ` Liam R. Howlett

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

all inboxes | Powered by JetHome®