public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Josh Triplett <josh@joshtriplett.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] srcu: queue work without holding the lock
Date: Thu, 12 Oct 2017 11:24:54 -0700	[thread overview]
Message-ID: <20171012182454.GG3521@linux.vnet.ibm.com> (raw)
In-Reply-To: <20171012085334.slen6jkovswhxbt7@linutronix.de>

On Thu, Oct 12, 2017 at 10:53:35AM +0200, Sebastian Andrzej Siewior wrote:
> On 2017-10-10 14:43:13 [-0700], Paul E. McKenney wrote:
> > diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
> > index 6d5880089ff6..558f9e7b283e 100644
> > --- a/kernel/rcu/srcutree.c
> > +++ b/kernel/rcu/srcutree.c
> > @@ -830,7 +866,7 @@ void __call_srcu(struct srcu_struct *sp, struct rcu_head *rhp,
> >  	rhp->func = func;
> >  	local_irq_save(flags);
> >  	sdp = this_cpu_ptr(sp->sda);
> > -	raw_spin_lock_rcu_node(sdp);
> > +	spin_lock_rcu_node(sdp);
> 
> This and the same thing in srcu_might_be_idle() does not work because
>   local_irq_save() + spin_lock() != spin_lock_irqsave()
> but
>   local_irq_save() + raw_spinlock = raw_spin_lock_irqsave()
> 
> I think that preempt_disable() for a stable this_cpu_ptr() is enough
> here. I replaced local_irq_save() with local_lock_irqsave() on RT which
> provides a per-CPU spinlock (for mutual exclusion) and disables
> interrupts in !RT mode.
> 
> I've been testing this for a while and it seems to work. Thank you.

So I keep mainline as is, and the local_irq_save()-to-local_lock_irqsave()
conversion happens in -rt, given that mainline doesn't have a
local_lock_irqsave(), correct?

And just so you know, there is one patchset adding call_srcu() that I am
following up on.  Looks to me like it is OK with this change, but if not,
well, back to the drawing board...  :-/

							Thanx, Paul

> >  	rcu_segcblist_enqueue(&sdp->srcu_cblist, rhp, false);
> >  	rcu_segcblist_advance(&sdp->srcu_cblist,
> >  			      rcu_seq_current(&sp->srcu_gp_seq));
> 
> 
> Sebastian
> 

  reply	other threads:[~2017-10-12 18:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-22 15:28 [PATCH 1/3] srcu: use cpu_online() instead custom check Sebastian Andrzej Siewior
2017-09-22 15:28 ` [PATCH 2/3] srcu: queue work without holding the lock Sebastian Andrzej Siewior
2017-09-22 18:46   ` Paul E. McKenney
2017-09-28 16:03     ` Sebastian Andrzej Siewior
2017-09-29  1:10       ` Paul E. McKenney
2017-10-10 21:43         ` Paul E. McKenney
2017-10-11 16:40           ` Sebastian Andrzej Siewior
2017-10-11 16:46             ` Paul E. McKenney
2017-10-12  8:53           ` Sebastian Andrzej Siewior
2017-10-12 18:24             ` Paul E. McKenney [this message]
2017-10-13  7:08               ` Sebastian Andrzej Siewior
2017-09-22 15:28 ` [PATCH 3/3] rcu/segcblist: include rcupdate.h Sebastian Andrzej Siewior
2017-09-22 18:47   ` Paul E. McKenney
2017-09-22 18:43 ` [PATCH 1/3] srcu: use cpu_online() instead custom check Paul E. McKenney
2017-09-28 16:02   ` Sebastian Andrzej Siewior
2017-09-29  1:09     ` Paul E. McKenney

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=20171012182454.GG3521@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=bigeasy@linutronix.de \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --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