locking/lockdep: Throw away all lock chains with zapped class
authorWaiman Long <longman@redhat.com>
Thu, 6 Feb 2020 15:24:06 +0000 (10:24 -0500)
committerIngo Molnar <mingo@kernel.org>
Tue, 11 Feb 2020 12:10:50 +0000 (13:10 +0100)
commit836bd74b5957779171c9648e9e29145fc089fffe
treedba3face57c6512c2408c472d9dcb4281a3e1427
parent1d44bcb4fdb650b2a57c9ff593a4d246a10ad801
locking/lockdep: Throw away all lock chains with zapped class

If a lock chain contains a class that is zapped, the whole lock chain is
likely to be invalid. If the zapped class is at the end of the chain,
the partial chain without the zapped class should have been stored
already as the current code will store all its predecessor chains. If
the zapped class is somewhere in the middle, there is no guarantee that
the partial chain will actually happen. It may just clutter up the hash
and make searching slower. I would rather prefer storing the chain only
when it actually happens.

So just dump the corresponding chain_hlocks entries for now. A latter
patch will try to reuse the freed chain_hlocks entries.

This patch also changes the type of nr_chain_hlocks to unsigned integer
to be consistent with the other counters.

Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20200206152408.24165-5-longman@redhat.com
kernel/locking/lockdep.c
kernel/locking/lockdep_internals.h
kernel/locking/lockdep_proc.c