lkml.org 
[lkml]   [2020]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip: locking/core] lockdep: Fix lockdep recursion
On Mon, Oct 12, 2020 at 02:28:12PM -0700, Paul E. McKenney wrote:
> It is certainly an accident waiting to happen. Would something like
> the following make sense?

Sadly no.

> ------------------------------------------------------------------------
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index bfd38f2..52a63bc 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -4067,6 +4067,7 @@ void rcu_cpu_starting(unsigned int cpu)
>
> rnp = rdp->mynode;
> mask = rdp->grpmask;
> + lockdep_off();
> raw_spin_lock_irqsave_rcu_node(rnp, flags);
> WRITE_ONCE(rnp->qsmaskinitnext, rnp->qsmaskinitnext | mask);
> newcpu = !(rnp->expmaskinitnext & mask);
> @@ -4086,6 +4087,7 @@ void rcu_cpu_starting(unsigned int cpu)
> } else {
> raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
> }
> + lockdep_on();
> smp_mb(); /* Ensure RCU read-side usage follows above initialization. */
> }

This will just shut it up, but will not fix the actual problem of that
spin-lock ending up in trace_lock_acquire() which relies on RCU which
isn't looking.

What we need here is to supress tracing not lockdep. Let me consider.

\
 
 \ /
  Last update: 2020-10-13 12:35    [W:0.190 / U:2.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site