linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Sven Schnelle <svens@linux.ibm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	the arch/x86 maintainers <x86@kernel.org>
Subject: Re: [GIT pull] locking/urgent for v5.10-rc6
Date: Tue, 1 Dec 2020 06:46:44 -0800	[thread overview]
Message-ID: <20201201144644.GF1437@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <20201201110724.GL3092@hirez.programming.kicks-ass.net>

On Tue, Dec 01, 2020 at 12:07:24PM +0100, Peter Zijlstra wrote:
> On Tue, Dec 01, 2020 at 09:07:34AM +0100, Peter Zijlstra wrote:
> > On Mon, Nov 30, 2020 at 08:31:32PM +0100, Christian Borntraeger wrote:
> > > On 30.11.20 19:04, Linus Torvalds wrote:
> > > > On Mon, Nov 30, 2020 at 5:03 AM Peter Zijlstra <peterz@infradead.org> wrote:
> > > >>
> > > >>> But but but...
> > > >>>
> > > >>>   do_idle()                   # IRQs on
> > > >>>     local_irq_disable();      # IRQs off
> > > >>>     defaul_idle_call()        # IRQs off
> > > >>         lockdep_hardirqs_on();  # IRQs off, but lockdep things they're on
> > > >>>       arch_cpu_idle()         # IRQs off
> > > >>>         enabled_wait()        # IRQs off
> > > >>>         raw_local_save()      # still off
> > > >>>         psw_idle()            # very much off
> > > >>>           ext_int_handler     # get an interrupt ?!?!
> > > >>               rcu_irq_enter()   # lockdep thinks IRQs are on <- FAIL
> > > >>
> > > >> I can't much read s390 assembler, but ext_int_handler() has a
> > > >> TRACE_IRQS_OFF, which would be sufficient to re-align the lockdep state
> > > >> with the actual state, but there's some condition before it, what's that
> > > >> test and is that right?
> > > > 
> > > > I think that "psw_idle()" enables interrupts, exactly like x86 does.
> > 
> > (like ye olde x86, modern x86 idles with interrupts disabled)
> > 
> > > Yes, by definition.  Otherwise it would be an software error state.
> > > The interesting part is the lpswe instruction at the end (load PSW) 
> > > which loads the full PSW, which contains interrupt enablement, wait bit,
> > > condition code, paging enablement, machine check enablement the address
> > > and others. The idle psw is enabled for interrupts and has the wait bit
> > > set. If the wait bit is set and interrupts are off this is called "disabled
> > > wait" and is used for panic, shutdown etc. 
> > 
> > OK, but at that point, hardware interrupt state is on, lockdep thinks
> > it's on. And we take an interrupt, just like any old regular interrupt
> > enabled region.
> > 
> > But then the exception handler (ext_int_handler), which I'm assuming is
> > ran by the hardware with hardware interrupts disabled again, should be
> > calling into lockdep to tell interrupts were disabled. IOW that
> > TRACE_IRQS_OFF bit in there.
> > 
> > But that doesn't seem to be working right. Why? Because afaict this is
> > then the exact normal flow of things, but it's only going sideways
> > during this idle thing.
> > 
> > What's going 'funny' ?
> 
> So after having talked to Sven a bit, the thing that is happening, is
> that this is the one place where we take interrupts with RCU being
> disabled. Normally RCU is watching and all is well, except during idle.

Isn't interrupt entry supposed to invoke rcu_irq_enter() at some point?
Or did this fall victim to recent optimizations?

							Thanx, Paul

  reply	other threads:[~2020-12-01 14:47 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-29 13:37 [GIT pull] irq/urgent for v5.10-rc6 Thomas Gleixner
2020-11-29 13:38 ` [GIT pull] locking/urgent " Thomas Gleixner
2020-11-29 19:31   ` Linus Torvalds
2020-11-30  0:29     ` Paul E. McKenney
2020-11-30  7:56     ` Peter Zijlstra
2020-11-30  8:23       ` Sven Schnelle
2020-11-30 12:31         ` Sven Schnelle
2020-11-30 12:52           ` Peter Zijlstra
2020-11-30 13:03             ` Peter Zijlstra
2020-11-30 18:04               ` Linus Torvalds
2020-11-30 19:31                 ` Christian Borntraeger
2020-12-01  8:07                   ` Peter Zijlstra
2020-12-01 11:07                     ` Peter Zijlstra
2020-12-01 14:46                       ` Paul E. McKenney [this message]
2020-12-01 14:55                         ` Peter Zijlstra
2020-12-01 16:53                           ` Paul E. McKenney
2020-12-01 18:15                           ` Peter Zijlstra
2020-12-01 18:48                             ` Peter Zijlstra
2020-12-01 18:57                             ` Mark Rutland
2020-12-01 19:14                               ` Peter Zijlstra
2020-12-01 19:18                                 ` Heiko Carstens
2020-12-02  9:21                                   ` Peter Zijlstra
2020-12-02 10:56                                     ` Heiko Carstens
2020-12-02 11:16                                       ` Mark Rutland
2020-12-02 13:46                                         ` Heiko Carstens
2020-12-02 12:27                                       ` Peter Zijlstra
2020-12-01  7:48               ` Sven Schnelle
2020-12-02  7:54               ` Heiko Carstens
2020-12-02  9:38                 ` Peter Zijlstra
2020-12-02 10:52                   ` Heiko Carstens
2020-11-30  8:36       ` Peter Zijlstra
2020-11-30 17:55       ` Linus Torvalds
2020-12-01  7:39         ` Peter Zijlstra
2020-12-01  7:56           ` Peter Zijlstra
2020-12-01 19:45             ` Linus Torvalds
2020-12-02  7:53               ` Peter Zijlstra
2020-11-29 20:06   ` pr-tracker-bot
2020-11-29 20:06 ` [GIT pull] irq/urgent " pr-tracker-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201201144644.GF1437@paulmck-ThinkPad-P72 \
    --to=paulmck@kernel.org \
    --cc=borntraeger@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=svens@linux.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).