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=69915897c5ca430804966e150453709ec5d848df;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 a71ee66..9b3210a 100644 --- a/urcu-qsbr.c +++ b/urcu-qsbr.c @@ -115,6 +115,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) {