From: Mathieu Desnoyers Date: Sun, 11 Sep 2011 06:03:09 +0000 (-0700) Subject: QSBR: add missing wakeups in synchronize_rcu code X-Git-Tag: v0.7.0~43^2~157 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=158cf657906dce346cb7197b1e9ce7f12076f5e8;p=urcu.git QSBR: add missing wakeups in synchronize_rcu code synchronize_rcu go into offline mode during grace period. It duplicates the rcu_thread_online/offline code, and therefore adding the required wake_up_gp() is required there too. Failure to do so leads to grace period hangs. Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu-qsbr.c b/urcu-qsbr.c index 5e43484..1dc9979 100644 --- a/urcu-qsbr.c +++ b/urcu-qsbr.c @@ -218,8 +218,11 @@ void synchronize_rcu(void) * our own quiescent state. This allows using synchronize_rcu() * in threads registered as readers. */ - if (was_online) + if (was_online) { CMM_STORE_SHARED(rcu_reader.ctr, 0); + cmm_smp_mb(); /* write rcu_reader.ctr before read futex */ + wake_up_gp(); + } mutex_lock(&rcu_gp_lock); @@ -277,8 +280,11 @@ void synchronize_rcu(void) * in threads registered as readers. */ cmm_smp_mb(); - if (was_online) + if (was_online) { CMM_STORE_SHARED(rcu_reader.ctr, 0); + cmm_smp_mb(); /* write rcu_reader.ctr before read futex */ + wake_up_gp(); + } mutex_lock(&rcu_gp_lock); if (cds_list_empty(®istry))