public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Neeraj Upadhyay <neeraju@codeaurora.org>,
	josh@joshtriplett.org, mathieu.desnoyers@efficios.com,
	jiangshanlai@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rcu/tree: Fix self wakeups for grace period kthread
Date: Tue, 12 Mar 2019 08:36:44 -0700	[thread overview]
Message-ID: <20190312153644.GA13351@linux.ibm.com> (raw)
In-Reply-To: <20190312105608.15994a1d@gandalf.local.home>

On Tue, Mar 12, 2019 at 10:56:08AM -0400, Steven Rostedt wrote:
> On Tue, 12 Mar 2019 07:09:23 -0700
> "Paul E. McKenney" <paulmck@linux.ibm.com> wrote:
> 
> > On Tue, Mar 12, 2019 at 05:25:28PM +0530, Neeraj Upadhyay wrote:
> > > On 3/12/19 7:20 AM, Steven Rostedt wrote:  
> > > >On Fri,  8 Mar 2019 15:16:18 +0530
> > > >Neeraj Upadhyay <neeraju@codeaurora.org> wrote:
> > > >  
> > > >>Update the code to match the comment that self wakeup of
> > > >>grace period kthread is allowed from interrupt handler, and
> > > >>softirq handler, running in the grace period kthread's
> > > >>context. Present code allows self wakeups from all
> > > >>interrupt contexts - nmi, softirq and hardirq contexts.  
> > > >
> > > >That's not actually the issue. But it appears that we return if we
> > > >simply have BH disabled, which I don't think we want, and we don't care
> > > >about NMI as NMI should never call this code.
> > > >
> > > >I think your patch is correct, but the change log is not.  
> > 
> > How about this?
> > 
> > 	The current rcu_gp_kthread_wake() function uses in_interrupt()
> > 	and thus does a self-wakeup from all interrupt contexts,
> > 	including the pointless case where the GP kthread happens to be
> > 	running with bottom halves disabled, along with the impossible
> > 	case where the GP kthread is running within an NMI handler (you
> > 	are not supposed to invoke rcu_gp_kthread_wake() from within an
> > 	NMI handler.  This commit therefore replaces the in_interrupt()
> > 	with in_irq(), so that the self-wakeups happen only from handlers
> > 	for hardware interrupts and softirqs.  This also makes the code
> > 	match the comment.
> 
> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

Applied, thank you!

							Thanx, Paul

> > > >-- Steve
> > > >  
> > > 
> > > Hi Steve, sorry, I don't understand fully, why we want to not return
> > > in BH disabled case. From the commit logs and lkml discussion, there
> > > is a case where GP kthread is interrupted in the wait event path and
> > > rcu_gp_kthread_wake() is called in softirq handler (I am not sure
> > > about interrupt handler case; how rcu_gp_kthread_wake() is called
> > > from that path).
> 
> BH disabled case isn't a case where the kthread is preempted. It's just
> that the kthread disabled BH, and thus we want to return.
> 
> -- Steve
> 


      reply	other threads:[~2019-03-12 15:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-08  9:46 [PATCH] rcu/tree: Fix self wakeups for grace period kthread Neeraj Upadhyay
2019-03-12  1:50 ` Steven Rostedt
2019-03-12 11:55   ` Neeraj Upadhyay
2019-03-12 14:09     ` Paul E. McKenney
2019-03-12 14:56       ` Steven Rostedt
2019-03-12 15:36         ` Paul E. McKenney [this message]

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=20190312153644.GA13351@linux.ibm.com \
    --to=paulmck@linux.ibm.com \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=neeraju@codeaurora.org \
    --cc=rostedt@goodmis.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