From: Waiman Long <longman@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>, Will Deacon <will.deacon@arm.com>
Cc: linux-kernel@vger.kernel.org,
Bart Van Assche <bvanassche@acm.org>,
Waiman Long <longman@redhat.com>
Subject: [PATCH v4 0/7] locking/lockdep: Reuse zapped chain_hlocks entries
Date: Tue, 21 Jan 2020 10:40:02 -0500 [thread overview]
Message-ID: <20200121154009.11993-1-longman@redhat.com> (raw)
v4:
- Fix build errors reported by kbuild test robot.
- Adopt the single chain block allocator code suggested by PeterZ which
combine the last 3 patches of v3 series.
- Add another patch to introduce a fast path in the chain block
allocator.
- In patch 1, move the inc_chains() out of CONFIG_TRACE_IRQFLAGS
conditional compilation block.
v3:
- Move the bug fix patches to the beginning of the series.
- Include a number of changes as suggested by PeterZ.
- Increase MAX_CHAIN_BUCKETS from 8 to 10 to reduce the chance of using
the unsized list.
- Add patch 7 to add a lockdep_early_init() call.
- Add patch 8 to allocate chain hlocks by splitting large chain block
as a last resort.
v2:
- Revamp the chain_hlocks reuse patch to store the freed chain_hlocks
information in the chain_hlocks entries themselves avoiding the
need of a separate set of tracking structures. This, however,
requires a minimum allocation size of at least 2. Thanks to PeterZ
for his review and inspiring this change.
- Remove the leakage counter as it is no longer applicable.
- Add patch 6 to make the output of /proc/lockdep_chains more readable.
It was found that when running a workload that kept on adding lock
classes and then zapping them repetitively, the system will eventually
run out of chain_hlocks[] entries even though there were still plenty
of other lockdep data buffers available.
[ 4318.443670] BUG: MAX_LOCKDEP_CHAIN_HLOCKS too low!
[ 4318.444809] turning off the locking correctness validator.
In order to fix this problem, we have to make chain_hlocks[] entries
reusable just like other lockdep arrays. Besides that, the patchset
also adds some zapped class and chain_hlocks counters to be tracked by
/proc/lockdep_stats. It also fixes leakage in the irq context counters
and makes the output of /proc/lockdep_chains more readable.
Waiman Long (7):
locking/lockdep: Decrement irq context counters when removing lock
chain
locking/lockdep: Display irq_context names in /proc/lockdep_chains
locking/lockdep: Track number of zapped classes
locking/lockdep: Throw away all lock chains with zapped class
locking/lockdep: Track number of zapped lock chains
locking/lockdep: Reuse freed chain_hlocks entries
locking/lockdep: Add a fast path for chain_hlocks allocation
kernel/locking/lockdep.c | 335 ++++++++++++++++++++++++-----
kernel/locking/lockdep_internals.h | 13 +-
kernel/locking/lockdep_proc.c | 26 ++-
3 files changed, 309 insertions(+), 65 deletions(-)
--
2.18.1
next reply other threads:[~2020-01-21 15:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-21 15:40 Waiman Long [this message]
2020-01-21 15:40 ` [PATCH v4 1/7] locking/lockdep: Decrement irq context counters when removing lock chain Waiman Long
2020-01-21 15:40 ` [PATCH v4 2/7] locking/lockdep: Display irq_context names in /proc/lockdep_chains Waiman Long
2020-01-21 15:40 ` [PATCH v4 3/7] locking/lockdep: Track number of zapped classes Waiman Long
2020-01-21 15:40 ` [PATCH v4 4/7] locking/lockdep: Throw away all lock chains with zapped class Waiman Long
2020-01-21 15:40 ` [PATCH v4 5/7] locking/lockdep: Track number of zapped lock chains Waiman Long
2020-01-24 13:18 ` kbuild test robot
2020-01-24 20:15 ` kbuild test robot
2020-01-21 15:40 ` [PATCH v4 6/7] locking/lockdep: Reuse freed chain_hlocks entries Waiman Long
2020-01-24 11:57 ` kbuild test robot
2020-01-21 15:40 ` [PATCH v4 7/7] locking/lockdep: Add a fast path for chain_hlocks allocation Waiman Long
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200121154009.11993-1-longman@redhat.com \
--to=longman@redhat.com \
--cc=bvanassche@acm.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox