Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-28 Thread Paul E. McKenney
On Thu, Jun 28, 2018 at 02:13:15PM -0700, Joel Fernandes wrote: > On Thu, Jun 28, 2018 at 01:02:05PM -0700, Paul E. McKenney wrote: > > > > wrote: > [..] > > > > > > > > > So why this function-call structure? Well, you see, NMI > > > > > > > > > handlers can > > > > > > > > > take what appear to

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-28 Thread Joel Fernandes
On Thu, Jun 28, 2018 at 01:02:05PM -0700, Paul E. McKenney wrote: > > > wrote: [..] > > > > > > > > So why this function-call structure? Well, you see, NMI > > > > > > > > handlers can > > > > > > > > take what appear to RCU to be normal interrupts... > > > > > > > > > > > > > > > > (And I just

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-28 Thread Paul E. McKenney
On Sat, Jun 23, 2018 at 10:53:56AM -0700, Paul E. McKenney wrote: > On Fri, Jun 22, 2018 at 03:03:35PM -0700, Andy Lutomirski wrote: > > On Fri, Jun 22, 2018 at 2:14 PM Paul E. McKenney > > wrote: > > > > > > On Fri, Jun 22, 2018 at 05:00:42PM -0400, Steven Rostedt wrote: > > > > On Fri, 22 Jun 20

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-25 Thread Andy Lutomirski
On Mon, Jun 25, 2018 at 3:15 PM Steven Rostedt wrote: > > On Mon, 25 Jun 2018 13:47:08 -0700 > "Paul E. McKenney" wrote: > > > On Mon, Jun 25, 2018 at 04:25:57PM -0400, Steven Rostedt wrote: > > > On Mon, 25 Jun 2018 09:39:51 -0700 > > > Joel Fernandes wrote: > > > > > > > For whatever its worth

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-25 Thread Andy Lutomirski
On Mon, Jun 25, 2018 at 3:16 PM Steven Rostedt wrote: > > On Mon, 25 Jun 2018 13:47:45 -0700 > Andy Lutomirski wrote: > > > > > As a straightforward example, NMI and MCE can nest inside each other. > > But I'm not sure how stable the machine becomes when MCE's start > interrupting NMIs. Also, can

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-25 Thread Steven Rostedt
On Mon, 25 Jun 2018 13:47:45 -0700 Andy Lutomirski wrote: > > As a straightforward example, NMI and MCE can nest inside each other. But I'm not sure how stable the machine becomes when MCE's start interrupting NMIs. Also, can MCE callbacks use RCU? > IIRC we treat #DB somewhat NMI-ish-ly as we

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-25 Thread Steven Rostedt
On Mon, 25 Jun 2018 13:47:08 -0700 "Paul E. McKenney" wrote: > On Mon, Jun 25, 2018 at 04:25:57PM -0400, Steven Rostedt wrote: > > On Mon, 25 Jun 2018 09:39:51 -0700 > > Joel Fernandes wrote: > > > > > For whatever its worth, I made some notes of what I understood from > > > reading > > > th

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-25 Thread Joel Fernandes
On Mon, Jun 25, 2018 at 04:25:57PM -0400, Steven Rostedt wrote: > On Mon, 25 Jun 2018 09:39:51 -0700 > Joel Fernandes wrote: > > > For whatever its worth, I made some notes of what I understood from reading > > the code and old posts because I was sure I would otherwise forget > > everything: > >

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-25 Thread Andy Lutomirski
On Mon, Jun 25, 2018 at 1:45 PM Paul E. McKenney wrote: > > On Mon, Jun 25, 2018 at 04:25:57PM -0400, Steven Rostedt wrote: > > On Mon, 25 Jun 2018 09:39:51 -0700 > > Joel Fernandes wrote: > > > > > For whatever its worth, I made some notes of what I understood from > > > reading > > > the code

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-25 Thread Paul E. McKenney
On Mon, Jun 25, 2018 at 04:25:57PM -0400, Steven Rostedt wrote: > On Mon, 25 Jun 2018 09:39:51 -0700 > Joel Fernandes wrote: > > > For whatever its worth, I made some notes of what I understood from reading > > the code and old posts because I was sure I would otherwise forget > > everything: > >

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-25 Thread Steven Rostedt
On Mon, 25 Jun 2018 09:39:51 -0700 Joel Fernandes wrote: > For whatever its worth, I made some notes of what I understood from reading > the code and old posts because I was sure I would otherwise forget > everything: > http://www.joelfernandes.org/linuxinternals/2018/06/15/rcu-dynticks.html Nic

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-25 Thread Joel Fernandes
Hi Paul, Thanks a lot for your comments, my replies inline: On Mon, Jun 25, 2018 at 10:19:20AM -0700, Paul E. McKenney wrote: > > Thanx, Paul > > > > When I trac

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-25 Thread Paul E. McKenney
On Mon, Jun 25, 2018 at 09:39:51AM -0700, Joel Fernandes wrote: > On Mon, Jun 25, 2018 at 05:28:24PM +0900, Byungchul Park wrote: > > On Fri, Jun 22, 2018 at 01:05:48PM -0700, Joel Fernandes wrote: > > > On Fri, Jun 22, 2018 at 02:32:47PM -0400, Steven Rostedt wrote: > > > > On Fri, 22 Jun 2018 11:

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-25 Thread Joel Fernandes
On Mon, Jun 25, 2018 at 05:28:24PM +0900, Byungchul Park wrote: > On Fri, Jun 22, 2018 at 01:05:48PM -0700, Joel Fernandes wrote: > > On Fri, Jun 22, 2018 at 02:32:47PM -0400, Steven Rostedt wrote: > > > On Fri, 22 Jun 2018 11:19:16 -0700 > > > Joel Fernandes wrote: > > > > > > > Sure. So in a la

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-25 Thread Byungchul Park
On Fri, Jun 22, 2018 at 01:05:48PM -0700, Joel Fernandes wrote: > On Fri, Jun 22, 2018 at 02:32:47PM -0400, Steven Rostedt wrote: > > On Fri, 22 Jun 2018 11:19:16 -0700 > > Joel Fernandes wrote: > > > > > Sure. So in a later thread you mentioned "usermode helpers". I took a > > > closer > > > lo

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-23 Thread Joel Fernandes
On Sat, Jun 23, 2018 at 10:56:34AM -0700, Paul E. McKenney wrote: > On Sat, Jun 23, 2018 at 08:48:39AM -0700, Joel Fernandes wrote: > > On Fri, Jun 22, 2018 at 02:16:00PM -0700, Paul E. McKenney wrote: > > > On Fri, Jun 22, 2018 at 05:00:42PM -0400, Steven Rostedt wrote: > > > > On Fri, 22 Jun 2018

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-23 Thread Paul E. McKenney
On Sat, Jun 23, 2018 at 08:48:39AM -0700, Joel Fernandes wrote: > On Fri, Jun 22, 2018 at 02:16:00PM -0700, Paul E. McKenney wrote: > > On Fri, Jun 22, 2018 at 05:00:42PM -0400, Steven Rostedt wrote: > > > On Fri, 22 Jun 2018 13:58:13 -0700 > > > "Paul E. McKenney" wrote: > > > > > > > Something

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-23 Thread Paul E. McKenney
On Fri, Jun 22, 2018 at 03:03:35PM -0700, Andy Lutomirski wrote: > On Fri, Jun 22, 2018 at 2:14 PM Paul E. McKenney > wrote: > > > > On Fri, Jun 22, 2018 at 05:00:42PM -0400, Steven Rostedt wrote: > > > On Fri, 22 Jun 2018 13:58:13 -0700 > > > "Paul E. McKenney" wrote: > > > > > > > Something lik

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-23 Thread Joel Fernandes
On Fri, Jun 22, 2018 at 02:16:00PM -0700, Paul E. McKenney wrote: > On Fri, Jun 22, 2018 at 05:00:42PM -0400, Steven Rostedt wrote: > > On Fri, 22 Jun 2018 13:58:13 -0700 > > "Paul E. McKenney" wrote: > > > > > Something like this: > > > > > > IRQ entered > > > > > > And never exited. Ever.

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-22 Thread Andy Lutomirski
On Fri, Jun 22, 2018 at 2:14 PM Paul E. McKenney wrote: > > On Fri, Jun 22, 2018 at 05:00:42PM -0400, Steven Rostedt wrote: > > On Fri, 22 Jun 2018 13:58:13 -0700 > > "Paul E. McKenney" wrote: > > > > > Something like this: > > > > > > IRQ entered > > > > > > And never exited. Ever. I actua

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-22 Thread Paul E. McKenney
On Fri, Jun 22, 2018 at 05:00:42PM -0400, Steven Rostedt wrote: > On Fri, 22 Jun 2018 13:58:13 -0700 > "Paul E. McKenney" wrote: > > > Something like this: > > > > IRQ entered > > > > And never exited. Ever. I actually saw this in 2011. > > I still believe this was actually a bug. And pe

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-22 Thread Steven Rostedt
On Fri, 22 Jun 2018 13:58:13 -0700 "Paul E. McKenney" wrote: > Something like this: > > IRQ entered > > And never exited. Ever. I actually saw this in 2011. I still believe this was actually a bug. And perhaps you made the RCU code robust enough to handle this bug ;-) > > Or somethin

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-22 Thread Paul E. McKenney
On Fri, Jun 22, 2018 at 02:32:47PM -0400, Steven Rostedt wrote: > On Fri, 22 Jun 2018 11:19:16 -0700 > Joel Fernandes wrote: > > > Sure. So in a later thread you mentioned "usermode helpers". I took a closer > > look at that subsystem, and it seems you can execute usermode helpers from > > atomic

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-22 Thread Paul E. McKenney
On Fri, Jun 22, 2018 at 11:19:16AM -0700, Joel Fernandes wrote: > On Fri, Jun 22, 2018 at 06:28:43AM -0700, Paul E. McKenney wrote: > > On Thu, Jun 21, 2018 at 10:56:59PM -0700, Joel Fernandes wrote: > > > Hi Paul, > > > > > > On Wed, Jun 20, 2018 at 09:49:02AM -0700, Paul E. McKenney wrote: > > >

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-22 Thread Joel Fernandes
On Fri, Jun 22, 2018 at 02:32:47PM -0400, Steven Rostedt wrote: > On Fri, 22 Jun 2018 11:19:16 -0700 > Joel Fernandes wrote: > > > Sure. So in a later thread you mentioned "usermode helpers". I took a closer > > look at that subsystem, and it seems you can execute usermode helpers from > > atomic

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-22 Thread Steven Rostedt
On Fri, 22 Jun 2018 11:19:16 -0700 Joel Fernandes wrote: > Sure. So in a later thread you mentioned "usermode helpers". I took a closer > look at that subsystem, and it seems you can execute usermode helpers from > atomic sections with help of UMH_NO_WAIT flag. > > Then I checked where this flag

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-22 Thread Joel Fernandes
On Fri, Jun 22, 2018 at 06:28:43AM -0700, Paul E. McKenney wrote: > On Thu, Jun 21, 2018 at 10:56:59PM -0700, Joel Fernandes wrote: > > Hi Paul, > > > > On Wed, Jun 20, 2018 at 09:49:02AM -0700, Paul E. McKenney wrote: > > > On Thu, Jun 21, 2018 at 01:05:22AM +0900, Byungchul Park wrote: > > > > O

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-22 Thread Paul E. McKenney
On Fri, Jun 22, 2018 at 12:01:49PM -0400, Steven Rostedt wrote: > On Fri, 22 Jun 2018 06:28:43 -0700 > "Paul E. McKenney" wrote: > > > It has been some years since I traced the code flow, but what happened > > back then is that it switches itself from an interrupt handler to not > > without actua

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-22 Thread Paul E. McKenney
On Fri, Jun 22, 2018 at 07:19:13AM -0700, Andy Lutomirski wrote: > On Fri, Jun 22, 2018 at 6:26 AM Paul E. McKenney > wrote: > > > > On Thu, Jun 21, 2018 at 10:56:59PM -0700, Joel Fernandes wrote: > > > Hi Paul, > > > > > > On Wed, Jun 20, 2018 at 09:49:02AM -0700, Paul E. McKenney wrote: > > > >

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-22 Thread Steven Rostedt
On Fri, 22 Jun 2018 06:28:43 -0700 "Paul E. McKenney" wrote: > It has been some years since I traced the code flow, but what happened > back then is that it switches itself from an interrupt handler to not > without actually returning from the interrupt. This can only happen when > interrupting

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-22 Thread Andy Lutomirski
On Fri, Jun 22, 2018 at 6:26 AM Paul E. McKenney wrote: > > On Thu, Jun 21, 2018 at 10:56:59PM -0700, Joel Fernandes wrote: > > Hi Paul, > > > > On Wed, Jun 20, 2018 at 09:49:02AM -0700, Paul E. McKenney wrote: > > > On Thu, Jun 21, 2018 at 01:05:22AM +0900, Byungchul Park wrote: > > > > On Wed, J

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-22 Thread Paul E. McKenney
On Fri, Jun 22, 2018 at 12:00:32PM +0900, Byungchul Park wrote: > On Thu, Jun 21, 2018 at 08:04:07AM -0700, Paul E. McKenney wrote: > > > Nothing quite like concurrent programming to help one see one's own > > mistakes. ;-) > > Haha. > > > Your reasoning has merit, but the nice thing about keep

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-22 Thread Paul E. McKenney
On Thu, Jun 21, 2018 at 10:56:59PM -0700, Joel Fernandes wrote: > Hi Paul, > > On Wed, Jun 20, 2018 at 09:49:02AM -0700, Paul E. McKenney wrote: > > On Thu, Jun 21, 2018 at 01:05:22AM +0900, Byungchul Park wrote: > > > On Wed, Jun 20, 2018 at 11:58 PM, Paul E. McKenney > > > wrote: > > > > On Wed

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-21 Thread Joel Fernandes
Hi Paul, On Wed, Jun 20, 2018 at 09:49:02AM -0700, Paul E. McKenney wrote: > On Thu, Jun 21, 2018 at 01:05:22AM +0900, Byungchul Park wrote: > > On Wed, Jun 20, 2018 at 11:58 PM, Paul E. McKenney > > wrote: > > > On Wed, Jun 20, 2018 at 05:47:20PM +0900, Byungchul Park wrote: > > >> Hello folks,

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-21 Thread Byungchul Park
On Thu, Jun 21, 2018 at 08:04:07AM -0700, Paul E. McKenney wrote: > Nothing quite like concurrent programming to help one see one's own > mistakes. ;-) Haha. > Your reasoning has merit, but the nice thing about keeping "nmi" is > that it helps casual readers see that NMIs must be handled. If w

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-21 Thread Paul E. McKenney
On Thu, Jun 21, 2018 at 07:08:30PM +0900, Byungchul Park wrote: > On Thu, Jun 21, 2018 at 03:39:49PM +0900, Byungchul Park wrote: > > [...] > > > I applied what you suggested and re-named rcu_nmi_{enter,exit} to >^ > rcu_nmi_

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-21 Thread Paul E. McKenney
On Thu, Jun 21, 2018 at 03:39:49PM +0900, Byungchul Park wrote: > On Wed, Jun 20, 2018 at 10:40:37AM -0700, Paul E. McKenney wrote: > > On Thu, Jun 21, 2018 at 02:15:07AM +0900, Byungchul Park wrote: > > [...] > > > > Totally agree with you. Sorry bothering you. > > > > Absolutely not a problem,

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-21 Thread Byungchul Park
On Thu, Jun 21, 2018 at 03:39:49PM +0900, Byungchul Park wrote: [...] > I applied what you suggested and re-named rcu_nmi_{enter,exit} to ^ rcu_nmi_{enter,exit}_common(bool irq) > rcu_irq_{enter,exit} and applied the same re-

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-20 Thread Byungchul Park
On Thu, Jun 21, 2018 at 03:39:49PM +0900, Byungchul Park wrote: > On Wed, Jun 20, 2018 at 10:40:37AM -0700, Paul E. McKenney wrote: > > On Thu, Jun 21, 2018 at 02:15:07AM +0900, Byungchul Park wrote: > > [...] > > > > Totally agree with you. Sorry bothering you. > > > > Absolutely not a problem,

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-20 Thread Byungchul Park
On Wed, Jun 20, 2018 at 10:40:37AM -0700, Paul E. McKenney wrote: > On Thu, Jun 21, 2018 at 02:15:07AM +0900, Byungchul Park wrote: [...] > > Totally agree with you. Sorry bothering you. > > Absolutely not a problem, absolutely no need to apologize! I am > actually very happy that you are takin

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-20 Thread Paul E. McKenney
On Thu, Jun 21, 2018 at 02:15:07AM +0900, Byungchul Park wrote: > On Thu, Jun 21, 2018 at 1:49 AM, Paul E. McKenney > wrote: > > [...] > > > Perhaps the fact that there are architectures that can enter interrupt > > handlers and never leave them when the CPU is non-idle. One example of > > this

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-20 Thread Byungchul Park
On Thu, Jun 21, 2018 at 1:49 AM, Paul E. McKenney wrote: [...] > Perhaps the fact that there are architectures that can enter interrupt > handlers and never leave them when the CPU is non-idle. One example of > this is the usermode upcalls in the comment that you removed. > > Or have all the ar

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-20 Thread Paul E. McKenney
that they did not. If that has changed, that would be a very good thing, but if not, this patch injects bugs. Thanx, Paul > >> Thoughs? > >> > >> ->8- > >> >From 84970b33eb06c3bb1bebbb1

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-20 Thread Byungchul Park
ciated if you explain it more about what I'm missing or your point :( > Thanx, Paul > >> Thoughs? >> >> ->8- >> >From 84970b33eb06c3bb1bebbb1754db405c0fc50fbe Mon Sep 17 00:00:00 2001 >> From: Byungchul Park >> Date

Re: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-20 Thread Paul E. McKenney
Thanx, Paul > Thoughs? > > ->8- > >From 84970b33eb06c3bb1bebbb1754db405c0fc50fbe Mon Sep 17 00:00:00 2001 > From: Byungchul Park > Date: Wed, 20 Jun 2018 16:01:20 +0900 > Subject: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu

[RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks

2018-06-20 Thread Byungchul Park
0 +0900 Subject: [RFC 2/2] rcu: Remove ->dynticks_nmi_nesting from struct rcu_dynticks The only thing we are interested in with regard to ->dynticks_nesting or ->dynticks_nmi_nesting is whether rcu is idle or not, which can be handled only using ->dynticks_nesting though. ->dynticks_nm