call_rcu: handle retry without wait correctly
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 9 Jun 2011 14:39:56 +0000 (10:39 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 9 Jun 2011 14:39:56 +0000 (10:39 -0400)
commitbc94ca9bada25f7403e3e859caa241146ae8e338
tree4355b9902fa921773d3363b1541a49cd696c9c72
parent4a620853d4b735f437ae6a1fe6c20db88aef6724
call_rcu: handle retry without wait correctly

The wait scheme has an implementation problem: if the list is not empty
when the !RT scheme checks for it, it will restart the loop and
decrement the futex (again) without calling call_rcu_wait() (which would
wait until it is set back to 0). So in this case, we can end up
decrementing "futex" to values well below -1.

Fix this by moving the decrement before the loop, and duplicate it after
return from call_rcu_wait() + poll() delay. Also move the "set futex to
0 upon stopping" outside of the loop: this is the only way the loop can
be stopped anyway.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu-call-rcu-impl.h
This page took 0.024547 seconds and 4 git commands to generate.