All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: paulmck@linux.vnet.ibm.com
Cc: Tejun Heo <tj@kernel.org>,
	dipankar@in.ibm.com, Andrew Morton <akpm@linux-foundation.org>,
	Jens Axboe <jens.axboe@oracle.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] RCU: implement rcu_read_[un]lock_preempt()
Date: Sat, 02 Aug 2008 01:06:13 +0200	[thread overview]
Message-ID: <1217631973.9016.19.camel@twins> (raw)
In-Reply-To: <20080801211029.GS14851@linux.vnet.ibm.com>

On Fri, 2008-08-01 at 14:10 -0700, Paul E. McKenney wrote:
> On Wed, Jul 16, 2008 at 08:07:49AM +0200, Peter Zijlstra wrote:
> > On Mon, 2008-07-14 at 14:57 +0900, Tejun Heo wrote:
> > > With the introduction of preemptible RCU, RCU doesn't gurantee that
> > > its critical section runs on the CPU it started to run.  As there are
> > > cases where non-preemptible RCU critical section makes sense, create
> > > new RCU read lock variants which turns of preemption -
> > > rcu_read_[un]lock_preempt() which are identical to rcu_read_[un]lock()
> > > for classic implementation and have enclosing preempt disable/enable
> > > for preemptible RCU.
> > > 
> > > Signed-off-by: Tejun Heo <tj@kernel.org>
> > 
> > Sorry, NAK.
> > 
> > If you need preempt off you need it for other reasons than RCU, so
> > mixing it in the interface doesn't make sense to me.
> 
> What Peter said.
> 
> For example, you could simply use preempt_disable() and preempt_enable()
> to guard the read side (or wrapper these as Mathieu suggests in
> http://lkml.org/lkml/2008/7/15/605, though Mathieu has not yet
> convinced me that these wrappers are a good idea), and then use either
> call_rcu_sched() or synchronize_sched() for the update side.
> 
> To summarize:
> 
> o	Replace your rcu_read_lock_preempt() with preempt_disable().
> 
> o	Replace your rcu_read_unlock_preempt() with preempt_enable().
> 
> o	Replace your use of call_rcu() with call_rcu_sched().
> 
> o	Replace your use of synchronize_rcu() with synchronize_sched().
> 
> And then you don't need these new primitives.
> 
> However!!!  This must be done carefully, as long sections of code
> with preemption disabled are really bad for realtime response.

Right - what I said in the other mail, we should really not use the
sched-RCU variant if we can avoid it.


      reply	other threads:[~2008-08-01 23:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-14  5:57 [PATCH] RCU: implement rcu_read_[un]lock_preempt() Tejun Heo
2008-07-16  6:07 ` Peter Zijlstra
2008-07-16  6:43   ` Tejun Heo
2008-07-28 15:13     ` Peter Zijlstra
2008-07-29  1:47       ` Tejun Heo
2008-07-29  6:15         ` Peter Zijlstra
2008-07-30  1:15           ` Tejun Heo
2008-08-01 21:10   ` Paul E. McKenney
2008-08-01 23:06     ` Peter Zijlstra [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=1217631973.9016.19.camel@twins \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=dipankar@in.ibm.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=tj@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.