lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 3 Dec 2009 06:41:44 -0800
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Lai Jiangshan <laijs@...fujitsu.com>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, dipankar@...ibm.com,
	akpm@...ux-foundation.org, mathieu.desnoyers@...ymtl.ca,
	josh@...htriplett.org, dvhltc@...ibm.com, niv@...ibm.com,
	tglx@...utronix.de, peterz@...radead.org, rostedt@...dmis.org,
	Valdis.Kletnieks@...edu, dhowells@...hat.com
Subject: Re: [PATCH tip/core/rcu 3/4] rcu: add expedited grace-period
	support for preemptible RCU

On Thu, Dec 03, 2009 at 05:26:24PM +0800, Lai Jiangshan wrote:
> Paul E. McKenney wrote:
> > From: Paul E. McKenney <paulmck@...ux.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ