The fix "Fix: high cpu usage in synchronize_rcu with long RCU read-side
C.S." has an imperfection in urcu.c and urcu-qsbr.c: when incrementing
the wait loop counter for the last time, the first conditional branch is
not taken, but the following conditionals are, and they assume the first
conditional has been taken.
Within urcu.c (urcu-mb, urcu-membarrier and urcu-signal), and
urcu-qsbr.c, this will simply skip the first wait_gp() call, without any
noticeable ill side-effect.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
* current rcu_gp.ctr value.
*/
for (;;) {
+ if (wait_loops < RCU_QS_ACTIVE_ATTEMPTS)
+ wait_loops++;
if (wait_loops >= RCU_QS_ACTIVE_ATTEMPTS) {
uatomic_set(&rcu_gp.futex, -1);
/*
}
/* Write futex before read reader_gp */
cmm_smp_mb();
- } else {
- wait_loops++;
}
cds_list_for_each_entry_safe(index, tmp, input_readers, node) {
switch (rcu_reader_state(&index->ctr)) {
* rcu_gp.ctr value.
*/
for (;;) {
+ if (wait_loops < RCU_QS_ACTIVE_ATTEMPTS)
+ wait_loops++;
if (wait_loops >= RCU_QS_ACTIVE_ATTEMPTS) {
uatomic_dec(&rcu_gp.futex);
/* Write futex before read reader_gp */
smp_mb_master(RCU_MB_GROUP);
- } else {
- wait_loops++;
}
cds_list_for_each_entry_safe(index, tmp, input_readers, node) {