Use the urcu_assert() macro (enabled on DEBUG_RCU) to check for
unmatched rcu_read_lock() that eventually leads to nesting counter
overflow in urcu.h and urcu-bp.h. This won't necessarily point the the
exact rcu_read_lock() that is unmatched, but will at least detect the
overflow condition.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
rcu_bp_register(); /* If not yet registered. */
cmm_barrier(); /* Ensure the compiler does not reorder us with mutex */
tmp = URCU_TLS(rcu_reader)->ctr;
+ urcu_assert((tmp & RCU_GP_CTR_NEST_MASK) != RCU_GP_CTR_NEST_MASK);
_rcu_read_lock_update(tmp);
}
urcu_assert(URCU_TLS(rcu_reader).registered);
cmm_barrier();
tmp = URCU_TLS(rcu_reader).ctr;
+ urcu_assert((tmp & RCU_GP_CTR_NEST_MASK) != RCU_GP_CTR_NEST_MASK);
_rcu_read_lock_update(tmp);
}