android_kernel_asus_sm8350/kernel/rcu
Paul E. McKenney 765a3f4fed rcu: Provide grace-period piggybacking API
The following pattern is currently not well supported by RCU:

1.	Make data element inaccessible to RCU readers.

2.	Do work that probably lasts for more than one grace period.

3.	Do something to make sure RCU readers in flight before #1 above
	have completed.

Here are some things that could currently be done:

a.	Do a synchronize_rcu() unconditionally at either #1 or #3 above.
	This works, but imposes needless work and latency.

b.	Post an RCU callback at #1 above that does a wakeup, then
	wait for the wakeup at #3.  This works well, but likely results
	in an extra unneeded grace period.  Open-coding this is also
	a bit more semi-tricky code than would be good.

This commit therefore adds get_state_synchronize_rcu() and
cond_synchronize_rcu() APIs.  Call get_state_synchronize_rcu() at #1
above and pass its return value to cond_synchronize_rcu() at #3 above.
This results in a call to synchronize_rcu() if no grace period has
elapsed between #1 and #3, but requires only a load, comparison, and
memory barrier if a full grace period did elapse.

Requested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
2014-03-20 17:12:25 -07:00
..
Makefile rcutorture: Abstract rcu_torture_random() 2014-02-23 09:00:58 -08:00
rcu.h rcu: Ensure kernel/rcu/rcu.h can be sourced/used stand-alone 2014-02-26 06:35:18 -08:00
rcutorture.c Merge branch 'torture.2014.02.23a' into HEAD 2014-02-26 06:38:59 -08:00
srcu.c rcu: Ensure kernel/rcu/rcu.h can be sourced/used stand-alone 2014-02-26 06:35:18 -08:00
tiny_plugin.h rcu: Stop tracking FSF's postal address 2014-02-17 15:01:37 -08:00
tiny.c rcu: Ensure kernel/rcu/rcu.h can be sourced/used stand-alone 2014-02-26 06:35:18 -08:00
tree_plugin.h Merge branches 'doc.2014.02.24a', 'fixes.2014.02.26a' and 'rt.2014.02.17b' into HEAD 2014-02-26 06:36:09 -08:00
tree_trace.c rcu: Stop tracking FSF's postal address 2014-02-17 15:01:37 -08:00
tree.c rcu: Provide grace-period piggybacking API 2014-03-20 17:12:25 -07:00
tree.h rcu: Stop tracking FSF's postal address 2014-02-17 15:01:37 -08:00
update.c rcu: Ensure kernel/rcu/rcu.h can be sourced/used stand-alone 2014-02-26 06:35:18 -08:00