That is fine ;-) Sum up the counters.
CPU1 CPU2
---- ----
T1 rcu_read_lock (+1)
read counter (0)
T2 rcu_read_lock (+1)
T2 rcu_read_unlock (-1)
read counter (0)
We'll find that zero is the sum of all counters, even though T1 is still in its read lock.If there were a nice way to swap out the counters then summing would work, unfortunately that introduces an even bigger race :-(
Thanks for the correction!