]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 9 Nov 2020 13:47:30 +0000 (14:47 +0100)
commit0a3346032d4cc7532d0f7c480e25605eac6a8a69
tree4bac241d7649548e7239479814deef04b81d049e
parent4bb10929b56ecbb8e229705450681be087ce10c0
locking/lockdep: Decrement IRQ context counters when removing lock chain

BugLink: https://bugs.launchpad.net/bugs/1900624
[ Upstream commit b3b9c187dc2544923a601733a85352b9ddaba9b3 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Ian May <ian.may@canonical.com>
kernel/locking/lockdep.c
kernel/locking/lockdep_internals.h