Re: [PATCH 15a/18] rhashtables: add lockdep tracking to bucket bit-spin-locks.

From
NeilBrown <hidden>
Date
2018-06-04 21:37:52
Also in
lkml
Reply to
Simon Horman, 2018-06-04
On Mon, Jun 04 2018, Simon Horman wrote:
On Mon, Jun 04, 2018 at 12:52:54PM +1000, NeilBrown wrote:
quoted
Native bit_spin_locks are not tracked by lockdep.

The bit_spin_locks used for rhashtable buckets are local
to the rhashtable implementation, so there is little opportunity
for the sort of misuse that lockdep might detect.
However locks are held while a hash function or compare
function is called, and if one of these took a lock,
a misbehaviour is possible.

As it is quite easy to add lockdep support this unlikely
possibility see to be enough justification.
nit: s/see/seems/
Thanks :-)  I've made that change for when I formally submit.

Thanks,
NeilBrown
quoted
So create a lockdep class for bucket bit_spin_lock as attach
through a lockdep_map in each bucket_table.

With the 'nested' annotation in rhashtable_rehash_one(), lockdep
correctly reports a possible problem as this lock it taken
while another bucket lock (in another table) is held.  This
confirms that the added support works.
With the correct nested annotation in place, lockdep reports
no problems.

Signed-off-by: NeilBrown <redacted>

Attachments

Thread (60 messages) 60 messages, 7 authors, last reply 2018-07-26
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help