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 3/5] locking/lockdep: Track number of zapped lock chains
Date: Thu, 12 Dec 2019 17:35:23 -0500 [thread overview]
Message-ID: <20191212223525.1652-4-longman@redhat.com> (raw)
In-Reply-To: <20191212223525.1652-1-longman@redhat.com>
Add a new counter nr_zapped_lock_chains to track the number lock chains
that have been removed.
Signed-off-by: Waiman Long <longman@redhat.com>
---
kernel/locking/lockdep.c | 2 ++
kernel/locking/lockdep_internals.h | 1 +
kernel/locking/lockdep_proc.c | 2 ++
3 files changed, 5 insertions(+)
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index d03503b348f1..b543bcc5ff50 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -2625,6 +2625,7 @@ check_prevs_add(struct task_struct *curr, struct held_lock *next)
struct lock_chain lock_chains[MAX_LOCKDEP_CHAINS];
static DECLARE_BITMAP(lock_chains_in_use, MAX_LOCKDEP_CHAINS);
static u16 chain_hlocks[MAX_LOCKDEP_CHAIN_HLOCKS];
+unsigned long nr_zapped_lock_chains;
unsigned int nr_chain_hlocks;
unsigned int nr_leaked_chain_hlocks;
@@ -4797,6 +4798,7 @@ static void remove_class_from_lock_chain(struct pending_free *pf,
*/
hlist_del_rcu(&chain->entry);
__set_bit(chain - lock_chains, pf->lock_chains_being_freed);
+ nr_zapped_lock_chains++;
#endif
}
diff --git a/kernel/locking/lockdep_internals.h b/kernel/locking/lockdep_internals.h
index b6ec9595ae88..4c23ab7d27c2 100644
--- a/kernel/locking/lockdep_internals.h
+++ b/kernel/locking/lockdep_internals.h
@@ -125,6 +125,7 @@ struct lock_class *lock_chain_get_class(struct lock_chain *chain, int i);
extern unsigned long nr_lock_classes;
extern unsigned long nr_zapped_classes;
+extern unsigned long nr_zapped_lock_chains;
extern unsigned long nr_list_entries;
long lockdep_next_lockchain(long i);
unsigned long lock_chain_count(void);
diff --git a/kernel/locking/lockdep_proc.c b/kernel/locking/lockdep_proc.c
index aab524530115..65a1b96238ef 100644
--- a/kernel/locking/lockdep_proc.c
+++ b/kernel/locking/lockdep_proc.c
@@ -345,6 +345,8 @@ static int lockdep_stats_show(struct seq_file *m, void *v)
seq_puts(m, "\n");
seq_printf(m, " zapped classes: %11lu\n",
nr_zapped_classes);
+ seq_printf(m, " zapped lock chains: %11lu\n",
+ nr_zapped_lock_chains);
seq_printf(m, " leaked chain hlocks: %11u\n",
nr_leaked_chain_hlocks);
return 0;
--
2.18.1
next prev parent reply other threads:[~2019-12-12 22:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-12 22:35 [PATCH 0/5] locking/lockdep: Reuse zapped chain_hlocks entries Waiman Long
2019-12-12 22:35 ` [PATCH 1/5] locking/lockdep: Track number of zapped classes Waiman Long
2019-12-12 22:35 ` [PATCH 2/5] locking/lockdep: Track leaked chain_hlocks entries Waiman Long
2019-12-12 22:35 ` Waiman Long [this message]
2019-12-12 22:35 ` [PATCH 4/5] locking/lockdep: Reuse free " Waiman Long
2019-12-13 10:25 ` Peter Zijlstra
2019-12-13 10:50 ` Peter Zijlstra
2019-12-13 16:02 ` Waiman Long
2019-12-13 16:05 ` Waiman Long
2019-12-13 18:12 ` Peter Zijlstra
[not found] ` <7ca26a9a-003f-6f24-08e4-f01b80e3e962@redhat.com>
2019-12-13 18:47 ` Peter Zijlstra
2019-12-13 20:08 ` Waiman Long
2019-12-15 17:06 ` Waiman Long
2019-12-13 15:02 ` Waiman Long
2019-12-13 18:43 ` Peter Zijlstra
2019-12-12 22:35 ` [PATCH 5/5] locking/lockdep: Decrement irq context counters when removing lock chain 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=20191212223525.1652-4-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