[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8fd7ce61-d8eb-6bde-7d41-54b9920e3e39@redhat.com>
Date: Tue, 4 Feb 2020 11:45:15 -0500
From: Waiman Long <longman@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...hat.com>, Will Deacon <will.deacon@....com>,
linux-kernel@...r.kernel.org, Bart Van Assche <bvanassche@....org>
Subject: Re: [PATCH v5 6/7] locking/lockdep: Reuse freed chain_hlocks entries
On 2/4/20 7:36 AM, Peter Zijlstra wrote:
> --- a/kernel/locking/lockdep_proc.c
> +++ b/kernel/locking/lockdep_proc.c
> @@ -278,9 +278,11 @@ static int lockdep_stats_show(struct seq
> #ifdef CONFIG_PROVE_LOCKING
> seq_printf(m, " dependency chains: %11lu [max: %lu]\n",
> lock_chain_count(), MAX_LOCKDEP_CHAINS);
> - seq_printf(m, " dependency chain hlocks: %11lu [max: %lu]\n",
> - MAX_LOCKDEP_CHAIN_HLOCKS - nr_free_chain_hlocks,
> + seq_printf(m, " dependency chain hlocks used: %11lu [max: %lu]\n",
> + MAX_LOCKDEP_CHAIN_HLOCKS - (nr_free_chain_hlocks - nr_lost_chain_hlocks),
> MAX_LOCKDEP_CHAIN_HLOCKS);
> + seq_printf(m, " dependency chain hlocks free: %11lu\n", nr_free_chain_hlocks);
> + seq_printf(m, " dependency chain hlocks lost: %11lu\n", nr_lost_chain_hlocks);
I do have some comments on this. There are three buckets now - free,
lost, used. They add up to MAX_LOCKDEP_CHAIN_HLOCKS. I don't think we
need to list all three. We can compute the third one by subtracting max
from the other two.
Something like:
diff --git a/kernel/locking/lockdep_proc.c b/kernel/locking/lockdep_proc.c
index 14932ea50317..6fe6a21c58d3 100644
--- a/kernel/locking/lockdep_proc.c
+++ b/kernel/locking/lockdep_proc.c
@@ -278,9 +278,12 @@ static int lockdep_stats_show(struct seq_file *m,
void *v)
#ifdef CONFIG_PROVE_LOCKING
seq_printf(m, " dependency chains: %11lu [max: %lu]\n",
lock_chain_count(), MAX_LOCKDEP_CHAINS);
- seq_printf(m, " dependency chain hlocks: %11lu [max: %lu]\n",
- MAX_LOCKDEP_CHAIN_HLOCKS - nr_free_chain_hlocks,
+ seq_printf(m, " dependency chain hlocks used: %11lu [max: %lu]\n",
+ MAX_LOCKDEP_CHAIN_HLOCKS -
+ (nr_free_chain_hlocks + nr_lost_chain_hlocks),
MAX_LOCKDEP_CHAIN_HLOCKS);
+ seq_printf(m, " dependency chain hlocks lost: %11lu\n",
+ nr_lost_chain_hlocks);
#endif
#ifdef CONFIG_TRACE_IRQFLAGS
Cheers,
Longman
Powered by blists - more mailing lists