]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
locking/lockdep: Decrement IRQ context counters when removing lock chain
authorWaiman Long <longman@redhat.com>
Thu, 6 Feb 2020 15:24:03 +0000 (10:24 -0500)
committerIngo Molnar <mingo@kernel.org>
Tue, 11 Feb 2020 12:10:48 +0000 (13:10 +0100)
commitb3b9c187dc2544923a601733a85352b9ddaba9b3
tree2c2b41e70bfd9d19ad847a43c3a501c8a99aa9b9
parent0a679e13ea30f85a1aef0669ee0c5a9fd7860b34
locking/lockdep: Decrement IRQ context counters when removing lock chain

There are currently three counters to track the IRQ context of a lock
chain - nr_hardirq_chains, nr_softirq_chains and nr_process_chains.
They are incremented when a new lock chain is added, but they are
not decremented when a lock chain is removed. That causes some of the
statistic counts reported by /proc/lockdep_stats to be incorrect.
IRQ
Fix that by decrementing the right counter when a lock chain is removed.

Since inc_chains() no longer accesses hardirq_context and softirq_context
directly, it is moved out from the CONFIG_TRACE_IRQFLAGS conditional
compilation block.

Fixes: a0b0fd53e1e6 ("locking/lockdep: Free lock classes that are no longer in use")
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-2-longman@redhat.com
kernel/locking/lockdep.c
kernel/locking/lockdep_internals.h