diff options
author | NeilBrown <neilb@suse.com> | 2019-04-02 01:07:45 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-08 04:12:12 +0200 |
commit | 149212f07856b25a9d342bfd6d736519b2ef66dc (patch) | |
tree | b2fc4e6c9902041bcdb4c8bfc44d2d5d3040088c /mm/kmemleak-test.c | |
parent | rhashtable: use bit_spin_locks to protect hash bucket. (diff) | |
download | linux-149212f07856b25a9d342bfd6d736519b2ef66dc.tar.xz linux-149212f07856b25a9d342bfd6d736519b2ef66dc.zip |
rhashtable: add lockdep tracking to bucket bit-spin-locks.
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 seems to be enough justification.
So create a lockdep class for bucket bit_spin_lock and attach
through a lockdep_map in each bucket_table.
Without the 'nested' annotation in rhashtable_rehash_one(), lockdep
correctly reports a possible problem as this lock is 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 <neilb@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'mm/kmemleak-test.c')
0 files changed, 0 insertions, 0 deletions