[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200316135507.GF12561@hirez.programming.kicks-ass.net>
Date: Mon, 16 Mar 2020 14:55:07 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Joel Fernandes <joel@...lfernandes.org>
Cc: Boqun Feng <boqun.feng@...il.com>, linux-kernel@...r.kernel.org,
rcu@...r.kernel.org, "Paul E. McKenney" <paulmck@...nel.org>,
Madhuparna Bhowmik <madhuparnabhowmik10@...il.com>,
Qian Cai <cai@....pw>, Ingo Molnar <mingo@...hat.com>,
Will Deacon <will@...nel.org>
Subject: Re: [PATCH] locking/lockdep: Avoid recursion in
lockdep_count_{for,back}ward_deps()
On Sat, Mar 14, 2020 at 09:04:22PM -0400, Joel Fernandes wrote:
> On Fri, Mar 13, 2020 at 10:33:25AM +0100, Peter Zijlstra wrote:
> Thanks Peter and Boqun, the below patch makes sense to me. Just had some nits
> below, otherwise:
> > @@ -1719,11 +1725,11 @@ unsigned long lockdep_count_forward_deps
> > this.class = class;
> >
> > raw_local_irq_save(flags);
> > - current->lockdep_recursion = 1;
> > + current->lockdep_recursion++;
> > arch_spin_lock(&lockdep_lock);
> > ret = __lockdep_count_forward_deps(&this);
> > arch_spin_unlock(&lockdep_lock);
> > - current->lockdep_recursion = 0;
> > + current->lockdep_recursion--;
>
> This doesn't look like it should recurse. Why not just use the
> lockdep_recursion_finish() helper here?
I chose to only add that to the sites that check recursion on entry.
Powered by blists - more mailing lists