From: Mathieu Desnoyers Date: Sat, 26 Sep 2009 22:29:37 +0000 (-0400) Subject: qsbr: only mark reader thread as being waited for in contended case X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=refs%2Fheads%2Furcu%2Fyield;p=userspace-rcu.git qsbr: only mark reader thread as being waited for in contended case Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu-qsbr.c b/urcu-qsbr.c index c275b66..ad3d17a 100644 --- a/urcu-qsbr.c +++ b/urcu-qsbr.c @@ -114,6 +114,9 @@ static void wait_for_quiescent_state(void) for (index = registry; index < registry + num_readers; index++) { int wait_loops = 0; + if (likely(!rcu_gp_ongoing(&index->urcu_reader_status->qs_gp))) + continue; + index->urcu_reader_status->gp_waiting = 1; while (rcu_gp_ongoing(&index->urcu_reader_status->qs_gp)) { if (wait_loops++ == RCU_QS_ACTIVE_ATTEMPTS) {