Now that you've put the barriers before taking lock, and after releasing
it, one can expand the _rcu_thread_{on,off}line call, and optimize two
barrier calls away. (this is patch 1/2).
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
* our own quiescent state. This allows using synchronize_rcu() in
* threads registered as readers.
*/
+ smp_mb();
if (was_online)
- _rcu_thread_offline();
+ STORE_SHARED(rcu_reader_qs_gp, 0);
- smp_mb();
internal_urcu_lock();
STORE_SHARED(urcu_gp_ctr, urcu_gp_ctr + 2);
wait_for_quiescent_state();
internal_urcu_unlock();
- smp_mb();
if (was_online)
- _rcu_thread_online();
+ _STORE_SHARED(rcu_reader_qs_gp, LOAD_SHARED(urcu_gp_ctr) + 1);
+ smp_mb();
}
/*