On Mon, Jun 03, 2019 at 10:38:48AM +0200, Peter Zijlstra wrote:
> On Sat, Jun 01, 2019 at 06:12:53PM -0700, Paul E. McKenney wrote:
> > Scheduling-clock interrupts can arrive late in the CPU-offline process,
> > after idle entry and the subsequent call to cpuhp_report_idle_dead().
> > Once execution passes the call to rcu_report_dead(), RCU is ignoring
> > the CPU, which results in lockdep complaints when the interrupt handler
> > uses RCU:
> 
> > diff --git a/kernel/cpu.c b/kernel/cpu.c
> > index 448efc06bb2d..3b33d83b793d 100644
> > --- a/kernel/cpu.c
> > +++ b/kernel/cpu.c
> > @@ -930,6 +930,7 @@ void cpuhp_report_idle_dead(void)
> >     struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
> >  
> >     BUG_ON(st->state != CPUHP_AP_OFFLINE);
> > +   local_irq_disable();
> >     rcu_report_dead(smp_processor_id());
> >     st->state = CPUHP_AP_IDLE_DEAD;
> >     udelay(1000);
> 
> Urgh... I'd almost suggest we do something like the below.
> 
> 
> But then I started looking at the various arch_cpu_idle_dead()
> implementations and ran into arm's implementation, which is calling
> complete() where generic code already established this isn't possible
> (see for example cpuhp_report_idle_dead()).

IIRC, that should have been migrated over to cpu_report_death(), as
arm64 was in commit:

  05981277a4de1ad6 ("arm64: Use common outgoing-CPU-notification code")

... but it looks like Paul's patch to do so [1] fell through the cracks;
I'm not aware of any reason that shouldn't have been taken.
  
[1] 
https://lore.kernel.org/lkml/1431467407-1223-8-git-send-email-paul...@linux.vnet.ibm.com/

Paul, do you want to resend that?

For arm64 we mask SError, debug, and FIQ exceptions later in our
cpu_die(). FIQ should never happen, but we could take SError or debug
exceptions, and I think we end up using RCU behind the scenes in the
handlers for those. :/

Thanks,
Mark.

Reply via email to