Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-21 Thread Paul E. McKenney
On Thu, May 21, 2020 at 08:41:11PM +0200, Thomas Gleixner wrote: > "Paul E. McKenney" writes: > > On Thu, May 21, 2020 at 10:31:11AM +0200, Thomas Gleixner wrote: > >> And I made this a NOP for for !NOHZ_FULL systems and avoided the call if > >> context tracking is not enabled at boot. > >> > >>

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-21 Thread Thomas Gleixner
"Paul E. McKenney" writes: > On Thu, May 21, 2020 at 10:31:11AM +0200, Thomas Gleixner wrote: >> And I made this a NOP for for !NOHZ_FULL systems and avoided the call if >> context tracking is not enabled at boot. >> >> void __rcu_irq_enter_check_tick(void); >> >> static inline void

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-21 Thread Paul E. McKenney
On Thu, May 21, 2020 at 10:31:11AM +0200, Thomas Gleixner wrote: > "Paul E. McKenney" writes: > > On Wed, May 20, 2020 at 03:15:31PM -0700, Paul E. McKenney wrote: > > Same patch, but with updated commit log based on IRC discussion > > with Andy. > > Fun. I came up with the same thing before

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-21 Thread Thomas Gleixner
"Paul E. McKenney" writes: > On Wed, May 20, 2020 at 03:15:31PM -0700, Paul E. McKenney wrote: > Same patch, but with updated commit log based on IRC discussion > with Andy. Fun. I came up with the same thing before going to bed. Just that I named the function differently:

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-20 Thread Paul E. McKenney
On Wed, May 20, 2020 at 03:15:31PM -0700, Paul E. McKenney wrote: > On Wed, May 20, 2020 at 09:49:18PM +0200, Thomas Gleixner wrote: > > "Paul E. McKenney" writes: > > > On Wed, May 20, 2020 at 09:51:17AM -0700, Andy Lutomirski wrote: > > >> Paul, the major change here is that if an IRQ hits

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-20 Thread Paul E. McKenney
On Wed, May 20, 2020 at 09:49:18PM +0200, Thomas Gleixner wrote: > "Paul E. McKenney" writes: > > On Wed, May 20, 2020 at 09:51:17AM -0700, Andy Lutomirski wrote: > >> Paul, the major change here is that if an IRQ hits normal kernel code > >> (i.e. code where RCU is watching and we're not in an

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-20 Thread Thomas Gleixner
"Paul E. McKenney" writes: > On Wed, May 20, 2020 at 09:51:17AM -0700, Andy Lutomirski wrote: >> Paul, the major change here is that if an IRQ hits normal kernel code >> (i.e. code where RCU is watching and we're not in an EQS), the IRQ >> won't call rcu_irq_enter() and rcu_irq_exit(). Instead

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-20 Thread Paul E. McKenney
On Wed, May 20, 2020 at 09:24:46PM +0200, Thomas Gleixner wrote: > Andy Lutomirski writes: > > On Wed, May 20, 2020 at 8:36 AM Andy Lutomirski wrote: > > if (user_mode(regs)) { > > enter_from_user_mode(); > > } else { > > if (!__rcu_is_watching()) { > > /* > >

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-20 Thread Thomas Gleixner
Andy Lutomirski writes: > On Wed, May 20, 2020 at 8:36 AM Andy Lutomirski wrote: > if (user_mode(regs)) { > enter_from_user_mode(); > } else { > if (!__rcu_is_watching()) { > /* > * If RCU is not watching then the same careful > *

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-20 Thread Thomas Gleixner
Andy Lutomirski writes: > So maybe the code can change to: > > if (user_mode(regs)) { > enter_from_user_mode(); > } else { > if (!__rcu_is_watching()) { > /* > * If RCU is not watching then the same careful > * sequence vs. lockdep and

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-20 Thread Paul E. McKenney
On Wed, May 20, 2020 at 10:47:29AM -0700, Andy Lutomirski wrote: > On Wed, May 20, 2020 at 10:38 AM Paul E. McKenney wrote: > > > > On Wed, May 20, 2020 at 08:36:06AM -0700, Andy Lutomirski wrote: > > > On Tue, May 19, 2020 at 7:23 PM Paul E. McKenney > > > wrote: > > > > On Tue, May 19, 2020

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-20 Thread Paul E. McKenney
On Wed, May 20, 2020 at 09:51:17AM -0700, Andy Lutomirski wrote: > On Wed, May 20, 2020 at 8:36 AM Andy Lutomirski wrote: > > > > On Tue, May 19, 2020 at 7:23 PM Paul E. McKenney wrote: > > > > > > On Tue, May 19, 2020 at 05:26:58PM -0700, Andy Lutomirski wrote: > > > > On Tue, May 19, 2020 at

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-20 Thread Andy Lutomirski
On Wed, May 20, 2020 at 10:38 AM Paul E. McKenney wrote: > > On Wed, May 20, 2020 at 08:36:06AM -0700, Andy Lutomirski wrote: > > On Tue, May 19, 2020 at 7:23 PM Paul E. McKenney wrote: > > > On Tue, May 19, 2020 at 05:26:58PM -0700, Andy Lutomirski wrote: > > > > On Tue, May 19, 2020 at 2:20 PM

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-20 Thread Paul E. McKenney
On Wed, May 20, 2020 at 08:36:06AM -0700, Andy Lutomirski wrote: > On Tue, May 19, 2020 at 7:23 PM Paul E. McKenney wrote: > > On Tue, May 19, 2020 at 05:26:58PM -0700, Andy Lutomirski wrote: > > > On Tue, May 19, 2020 at 2:20 PM Thomas Gleixner > > > wrote: > > > > Andy Lutomirski writes: > >

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-20 Thread Andy Lutomirski
On Wed, May 20, 2020 at 8:36 AM Andy Lutomirski wrote: > > On Tue, May 19, 2020 at 7:23 PM Paul E. McKenney wrote: > > > > On Tue, May 19, 2020 at 05:26:58PM -0700, Andy Lutomirski wrote: > > > On Tue, May 19, 2020 at 2:20 PM Thomas Gleixner > > > wrote: First, the patch as you submitted it

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-20 Thread Andy Lutomirski
On Tue, May 19, 2020 at 7:23 PM Paul E. McKenney wrote: > > On Tue, May 19, 2020 at 05:26:58PM -0700, Andy Lutomirski wrote: > > On Tue, May 19, 2020 at 2:20 PM Thomas Gleixner wrote: > > > > > > Andy Lutomirski writes: > > > > On Tue, May 19, 2020 at 1:20 PM Thomas Gleixner > > > > wrote: >

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-20 Thread Thomas Gleixner
Andy Lutomirski writes: > On Tue, May 19, 2020 at 2:20 PM Thomas Gleixner wrote: > Unless I've missed something, the effect here is that #PF hitting in > an RCU-watching context will skip rcu_irq_enter(), whereas all IRQs > (because you converted them) as well as other faults and traps will >

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-19 Thread Paul E. McKenney
On Tue, May 19, 2020 at 05:26:58PM -0700, Andy Lutomirski wrote: > On Tue, May 19, 2020 at 2:20 PM Thomas Gleixner wrote: > > > > Andy Lutomirski writes: > > > On Tue, May 19, 2020 at 1:20 PM Thomas Gleixner > > > wrote: > > >> Thomas Gleixner writes: > > >> It's about this: > > >> > > >>

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-19 Thread Andy Lutomirski
On Tue, May 19, 2020 at 2:20 PM Thomas Gleixner wrote: > > Andy Lutomirski writes: > > On Tue, May 19, 2020 at 1:20 PM Thomas Gleixner wrote: > >> Thomas Gleixner writes: > >> It's about this: > >> > >> rcu_nmi_enter() > >> { > >> if (!rcu_is_watching()) { > >> make it

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-19 Thread Thomas Gleixner
Andy Lutomirski writes: > On Tue, May 19, 2020 at 1:20 PM Thomas Gleixner wrote: >> Thomas Gleixner writes: >> It's about this: >> >> rcu_nmi_enter() >> { >> if (!rcu_is_watching()) { >> make it watch; >> } else if (!in_nmi()) { >>

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-19 Thread Andy Lutomirski
On Tue, May 19, 2020 at 1:20 PM Thomas Gleixner wrote: > > Thomas Gleixner writes: > > Andy Lutomirski writes: > >> On Fri, May 15, 2020 at 5:10 PM Thomas Gleixner wrote: > >>> The pagefault handler cannot use the regular idtentry_enter() because that > >>> invokes rcu_irq_enter() if the

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-19 Thread Thomas Gleixner
Thomas Gleixner writes: > Andy Lutomirski writes: >> On Fri, May 15, 2020 at 5:10 PM Thomas Gleixner wrote: >>> The pagefault handler cannot use the regular idtentry_enter() because that >>> invokes rcu_irq_enter() if the pagefault was caused in the kernel. Not a >>> problem per se, but kernel

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-19 Thread Thomas Gleixner
Andy Lutomirski writes: > On Fri, May 15, 2020 at 5:10 PM Thomas Gleixner wrote: >> The pagefault handler cannot use the regular idtentry_enter() because that >> invokes rcu_irq_enter() if the pagefault was caused in the kernel. Not a >> problem per se, but kernel side page faults can schedule

Re: [patch V6 12/37] x86/entry: Provide idtentry_entry/exit_cond_rcu()

2020-05-19 Thread Andy Lutomirski
On Fri, May 15, 2020 at 5:10 PM Thomas Gleixner wrote: > > > The pagefault handler cannot use the regular idtentry_enter() because that > invokes rcu_irq_enter() if the pagefault was caused in the kernel. Not a > problem per se, but kernel side page faults can schedule which is not > possible