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
..
2013-08-14 13:55:15 +05:30
2014-01-25 10:49:30 -08:00
2014-01-26 11:00:41 -08:00
2014-01-20 11:55:23 -08:00
2013-12-23 18:34:58 -08:00
2013-09-10 13:03:41 -07:00
2014-01-24 22:39:54 +01:00
2014-01-23 18:49:36 -08:00
2014-01-17 01:59:38 +01:00
2013-07-03 16:31:35 -07:00
2013-07-30 11:53:12 -04:00
2013-05-29 15:50:34 -04:00
2014-01-14 14:54:00 -05:00
2013-11-08 08:59:44 -07:00
2013-11-23 22:33:56 -08:00
2014-02-10 09:29:00 -07:00
2013-12-22 23:14:27 -08:00
2013-11-15 09:32:21 +09:00
2013-11-09 00:16:29 -05:00
2013-05-01 16:36:22 +05:30
2014-01-05 12:34:29 +01:00
2013-07-15 11:25:00 +09:30
2013-05-07 18:38:27 -07:00
2014-01-16 10:23:02 +10:30
2013-04-29 18:28:40 -07:00
2013-06-17 16:38:57 -07:00
2013-08-22 22:13:54 -07:00
2014-01-16 11:15:50 +01:00
2014-01-26 22:48:35 +01:00
2013-06-13 17:51:04 -07:00
2013-12-29 16:34:25 -05:00
2013-12-10 22:58:13 -08:00
2013-06-17 16:38:57 -07:00
2013-09-13 15:09:52 +02:00
2013-08-09 10:49:00 +02:00
2013-07-26 16:19:48 -07:00
2013-11-15 09:32:23 +09:00
2014-01-25 08:55:09 +01:00
2013-04-30 17:04:06 -07:00
2013-08-28 21:35:14 -07:00
2014-01-08 19:03:00 -02:00
2013-05-31 00:48:22 -07:00
2013-12-11 15:52:34 +01:00
2013-12-26 13:29:35 -05:00
2013-12-19 10:17:11 -07:00
2014-01-16 10:23:03 +10:30
2013-11-09 00:16:19 -05:00
2014-01-27 21:02:39 -08:00
2013-11-09 00:16:19 -05:00
2013-07-03 16:08:05 -07:00
2014-01-22 21:57:17 -08:00
2013-10-14 17:15:48 +02:00
2013-12-05 13:05:48 -08:00
2014-01-31 15:39:07 -08:00
2014-01-25 03:14:05 -05:00
2013-05-04 14:47:26 -04:00
2014-01-27 19:27:53 -05:00
2014-01-13 14:29:49 -08:00
2014-01-03 11:22:21 -08:00
2013-06-12 12:37:30 +01:00
2013-09-15 17:41:30 -04:00
2014-01-22 16:39:28 -08:00
2014-01-22 19:36:57 +01:00
2013-10-17 00:36:06 +02:00
2013-06-21 11:32:51 +02:00
2014-02-17 15:01:52 -08:00
2013-12-18 19:04:50 -08:00
2013-07-03 16:08:05 -07:00
2014-01-28 13:20:09 -08:00
2013-06-17 16:38:57 -07:00
2013-12-19 19:09:38 -05:00
2014-01-27 21:02:39 -08:00
2013-09-10 18:56:32 -04:00
2014-02-17 15:01:37 -08:00
2013-04-30 15:50:12 +05:30
2013-09-12 15:38:02 -07:00
2013-12-08 16:56:05 -08:00
2014-01-20 16:13:02 -08:00
2013-08-05 10:52:36 -06:00
2013-05-27 10:57:53 +09:00
2013-10-17 15:53:09 -04:00
2013-07-10 18:11:34 -07:00
2014-01-30 16:56:55 -08:00