lkml.org 
[lkml]   [2020]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] locking/lockdep: Avoid recursion in lockdep_count_{for,back}ward_deps()
On Mon, Mar 16, 2020 at 02:55:07PM +0100, Peter Zijlstra wrote:
> 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.

Makes sense, thank you Peter.

- Joel

\
 
 \ /
  Last update: 2020-03-16 16:02    [W:0.086 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site