From: Frederic Weisbecker <fweisbec@gmail.com>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: "Udo A. Steinberg" <udo@hypervisor.org>,
Joe Korty <joe.korty@ccur.com>,
mathieu.desnoyers@efficios.com, dhowells@redhat.com,
loic.minier@linaro.org, dhaval.giani@gmail.com,
tglx@linutronix.de, peterz@infradead.org,
linux-kernel@vger.kernel.org, josh@joshtriplett.org
Subject: Re: [PATCH] a local-timer-free version of RCU
Date: Mon, 8 Nov 2010 21:40:11 +0100 [thread overview]
Message-ID: <20101108204007.GB6777@nowhere> (raw)
In-Reply-To: <20101108193832.GB4032@linux.vnet.ibm.com>
On Mon, Nov 08, 2010 at 11:38:32AM -0800, Paul E. McKenney wrote:
> On Mon, Nov 08, 2010 at 04:32:17PM +0100, Frederic Weisbecker wrote:
> > So, this looks very scary for performances to add rcu_read_lock() in
> > preempt_disable() and local_irq_save(), that notwithstanding it won't
> > handle the "raw" rcu sched implicit path.
>
> Ah -- I would arrange for the rcu_read_lock() to be added only in the
> dyntick-hpc case. So no effect on normal builds, overhead is added only
> in the dyntick-hpc case.
Yeah sure, but I wonder if the resulting rcu config will have a
large performance impact because of that.
In fact, my worry is: if the last resort to have a sane non-timer based
rcu is to bloat fast path functions like preempt_disable() or local_irq...
(that notwithstanding we have a bloated rcu_read_unlock() on this rcu config
because of its main nature), wouldn't it be better to eventually pick the
syscall/exception tweaked fast path version?
Perhaps I'll need to measure the impact of both, but I suspect I'll get
controversial results depending on the workload.
> > There is also my idea from the other discussion: change rcu_read_lock_sched()
> > semantics and map it to rcu_read_lock() in this rcu config (would be a nop
> > in other configs). So every users of rcu_dereference_sched() would now need
> > to protect their critical section with this.
> > Would it be too late to change this semantic?
>
> I was expecting that we would fold RCU, RCU bh, and RCU sched into
> the same set of primitives (as Jim Houston did), but again only in the
> dyntick-hpc case.
Yeah, the resulting change must be NULL in others rcu configs.
> However, rcu_read_lock_bh() would still disable BH,
> and similarly, rcu_read_lock_sched() would still disable preemption.
Probably yeah, otherwise there will be a kind of sense split against
the usual rcu_read_lock() and everybody will be confused.
Perhaps we need a different API for the underlying rcu_read_lock()
call in the other flavours when preempt is already disabled or
bh is already disabled:
rcu_enter_read_lock_sched();
__rcu_read_lock_sched();
rcu_start_read_lock_sched();
(same for bh)
Hmm...
> > What is scary with this is that it also changes rcu sched semantics, and users
> > of call_rcu_sched() and synchronize_sched(), who rely on that to do more
> > tricky things than just waiting for rcu_derefence_sched() pointer grace periods,
> > like really wanting for preempt_disable and local_irq_save/disable, those
> > users will be screwed... :-( ...unless we also add relevant rcu_read_lock_sched()
> > for them...
>
> So rcu_read_lock() would be the underlying primitive. The implementation
> of rcu_read_lock_sched() would disable preemption and then invoke
> rcu_read_lock(). The implementation of rcu_read_lock_bh() would
> disable BH and then invoke rcu_read_lock(). This would allow
> synchronize_rcu_sched() and synchronize_rcu_bh() to simply invoke
> synchronize_rcu().
>
> Seem reasonable?
Perfect. That could be further optimized with what I said above but
other than that, that's what I was thinking about.
next prev parent reply other threads:[~2010-11-08 20:40 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-04 23:21 dyntick-hpc and RCU Paul E. McKenney
2010-11-05 5:27 ` Frederic Weisbecker
2010-11-05 5:38 ` Frederic Weisbecker
2010-11-05 15:06 ` Paul E. McKenney
2010-11-05 20:06 ` Dhaval Giani
2010-11-05 15:04 ` Paul E. McKenney
2010-11-08 14:10 ` Frederic Weisbecker
2010-11-05 21:00 ` [PATCH] a local-timer-free version of RCU Joe Korty
2010-11-06 19:28 ` Paul E. McKenney
2010-11-06 19:34 ` Mathieu Desnoyers
2010-11-06 19:42 ` Mathieu Desnoyers
2010-11-06 19:44 ` Paul E. McKenney
2010-11-08 2:11 ` Udo A. Steinberg
2010-11-08 2:19 ` Udo A. Steinberg
2010-11-08 2:54 ` Paul E. McKenney
2010-11-08 15:32 ` Frederic Weisbecker
2010-11-08 19:38 ` Paul E. McKenney
2010-11-08 20:40 ` Frederic Weisbecker [this message]
2010-11-10 18:08 ` Paul E. McKenney
2010-11-08 15:06 ` Frederic Weisbecker
2010-11-08 15:18 ` Joe Korty
2010-11-08 19:50 ` Paul E. McKenney
2010-11-08 19:49 ` Paul E. McKenney
2010-11-08 20:51 ` Frederic Weisbecker
2010-11-06 20:03 ` Mathieu Desnoyers
2010-11-09 9:22 ` Lai Jiangshan
2010-11-10 15:54 ` Frederic Weisbecker
2010-11-10 17:31 ` Peter Zijlstra
2010-11-10 17:45 ` Frederic Weisbecker
2010-11-11 4:19 ` Paul E. McKenney
2010-11-13 22:30 ` Frederic Weisbecker
2010-11-16 1:28 ` Paul E. McKenney
2010-11-16 13:52 ` Frederic Weisbecker
2010-11-16 15:51 ` Paul E. McKenney
2010-11-17 0:52 ` Frederic Weisbecker
2010-11-17 1:25 ` Paul E. McKenney
2011-03-07 20:31 ` [PATCH] An RCU for SMP with a single CPU garbage collector Joe Korty
[not found] ` <20110307210157.GG3104@linux.vnet.ibm.com>
2011-03-07 21:16 ` Joe Korty
2011-03-07 21:33 ` Joe Korty
2011-03-07 22:51 ` Joe Korty
2011-03-08 9:07 ` Paul E. McKenney
2011-03-08 15:57 ` Joe Korty
2011-03-08 22:53 ` Joe Korty
2011-03-10 0:30 ` Paul E. McKenney
2011-03-10 0:28 ` Paul E. McKenney
2011-03-09 22:29 ` Frederic Weisbecker
2011-03-09 22:15 ` [PATCH 2/4] jrcu: tap rcu_read_unlock Joe Korty
2011-03-10 0:34 ` Paul E. McKenney
2011-03-10 19:50 ` JRCU Theory of Operation Joe Korty
2011-03-12 14:36 ` Paul E. McKenney
2011-03-13 0:43 ` Joe Korty
2011-03-13 5:56 ` Paul E. McKenney
2011-03-13 23:53 ` Joe Korty
2011-03-14 0:50 ` Paul E. McKenney
2011-03-14 0:55 ` Josh Triplett
2011-03-09 22:16 ` [PATCH 3/4] jrcu: tap might_resched() Joe Korty
2011-03-09 22:17 ` [PATCH 4/4] jrcu: add new stat to /sys/kernel/debug/rcu/rcudata Joe Korty
2011-03-09 22:19 ` [PATCH 1/4] jrcu: remove preempt_enable() tap [resend] Joe Korty
2011-03-12 14:36 ` [PATCH] An RCU for SMP with a single CPU garbage collector Paul E. McKenney
2011-03-13 1:25 ` Joe Korty
2011-03-13 6:09 ` Paul E. McKenney
[not found] <757455806.950179.1289232791283.JavaMail.root@sz0076a.westchester.pa.mail.comcast.net>
2010-11-08 16:15 ` [PATCH] a local-timer-free version of RCU houston.jim
2010-11-08 19:52 ` 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=20101108204007.GB6777@nowhere \
--to=fweisbec@gmail.com \
--cc=dhaval.giani@gmail.com \
--cc=dhowells@redhat.com \
--cc=joe.korty@ccur.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loic.minier@linaro.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=udo@hypervisor.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