From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, dipankar@in.ibm.com,
akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca,
josh@joshtriplett.org, dvhltc@us.ibm.com, niv@us.ibm.com,
tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org,
Valdis.Kletnieks@vt.edu, dhowells@redhat.com
Subject: Re: [PATCH tip/core/rcu 3/4] rcu: add expedited grace-period support for preemptible RCU
Date: Thu, 3 Dec 2009 06:41:44 -0800 [thread overview]
Message-ID: <20091203144144.GA6822@linux.vnet.ibm.com> (raw)
In-Reply-To: <4B178440.5020701@cn.fujitsu.com>
On Thu, Dec 03, 2009 at 05:26:24PM +0800, Lai Jiangshan wrote:
> Paul E. McKenney wrote:
> > From: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> >
> > Implement an synchronize_rcu_expedited() for preemptible RCU that actually
> > is expedited. This uses synchronize_sched_expedited() to force all
> > threads currently running in a preemptible-RCU read-side critical section
> > onto the appropriate ->blocked_tasks[] list, then takes a snapshot of
> > all of these lists and waits for them to drain.
> >
>
> > 3. Add an implementation of synchronize_rcu_expedited() that
> > actually expedites preemptible-RCU grace periods.
>
> It's very nice.
I am glad you like it!
> But I don't understand all things.
>
> 1) Why it can be speeded up (in theory)?
> synchronize_sched_expedited() does speed up, it is due to
> migration_threads are the most highest priority threads.
>
> But for synchronize_rcu_expedited(), some preempted tasks in ->blocked_tasks[]
> may be waiting at runqueue for long long time because some other
> higher priority threads comes.
>
> simply comparison:
> synchronize_sched_expedited()
> ==> wake_up_process(rq->migration_thread) to force schedule on cpus.
> which forces read-sides notify the end earlier,
> or we can say "it forces read-sides run to end faster"
>
> synchronize_rcu_expedited()
> ==> Nothing to force preempted read-site run to end faster.
You are quite right, and this is one reason why one of the items on my
todo list is "RCU priority boosting". I am currently doing some work
to prepare for this by simplifying force_quiescent_state(). The general
idea will be to traverse the ->blocked_tasks[] lists to raise priorities
if the grace period goes too long.
That said, the purpose of synchronize_rcu_expedited() is not to provide
real-time response, but rather to provide short -average- grace-period
durations. In the common case, RCU read-side critical sections do not
get preempted to begin with, so in the common case, this implementation
of synchronize_sched_expedited() should provide short average grace-period
durations.
> 2) Why we introduce a API which no one use it.
> I remember that Net guys request a expedited synchronize_rcu().
> but currently there is still no one use it.
There have been several requests for it over the years, so I feel
justified providing it. If it is still unused some years hence, it
is really easy to remove it, but it is really hard to provide it on a
moment's notice.
> Beware my thinking may be wrong!
That would apply to both of us! ;-)
Thanx, Paul
next prev parent reply other threads:[~2009-12-03 14:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-02 20:09 [PATCH tip/core/rcu 0/4] rcu: preemptible expedited grace periods and cleanups Paul E. McKenney
2009-12-02 20:10 ` [PATCH tip/core/rcu 1/4] rcu: rename "quiet" functions Paul E. McKenney
2009-12-02 23:20 ` Josh Triplett
2009-12-03 13:22 ` [tip:core/rcu] rcu: Rename " tip-bot for Paul E. McKenney
2009-12-02 20:10 ` [PATCH tip/core/rcu 2/4] rcu: enable fourth level of TREE_RCU hierarchy Paul E. McKenney
2009-12-02 23:25 ` Josh Triplett
2009-12-03 0:20 ` Paul E. McKenney
2009-12-03 13:22 ` [tip:core/rcu] rcu: Enable " tip-bot for Paul E. McKenney
2009-12-02 20:10 ` [PATCH tip/core/rcu 3/4] rcu: add expedited grace-period support for preemptible RCU Paul E. McKenney
2009-12-03 9:26 ` Lai Jiangshan
2009-12-03 14:41 ` Paul E. McKenney [this message]
2009-12-03 13:22 ` [tip:core/rcu] rcu: Add " tip-bot for Paul E. McKenney
2009-12-02 20:10 ` [PATCH tip/core/rcu 4/4] rcu: make RCU's CPU-stall detector be default Paul E. McKenney
2009-12-03 13:22 ` [tip:core/rcu] rcu: Make " tip-bot for Paul E. McKenney
2009-12-03 8:53 ` [PATCH tip/core/rcu 0/4] rcu: preemptible expedited grace periods and cleanups Lai Jiangshan
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=20091203144144.GA6822@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=Valdis.Kletnieks@vt.edu \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=dipankar@in.ibm.com \
--cc=dvhltc@us.ibm.com \
--cc=josh@joshtriplett.org \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@polymtl.ca \
--cc=mingo@elte.hu \
--cc=niv@us.ibm.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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