summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorPaul E. McKenney <paul.mckenney@linaro.org>2012-05-28 19:21:41 -0700
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-07-02 12:34:03 -0700
commitc6ebcbb60c8c68a88160fe54302e851700d1362c (patch)
treed95b0c10d7107d3d34a108aa75222820157fd599 /usr
parente3f8d3788ed7cf55946030dc9b76e73edb111602 (diff)
downloadlwn-c6ebcbb60c8c68a88160fe54302e851700d1362c.tar.gz
lwn-c6ebcbb60c8c68a88160fe54302e851700d1362c.zip
rcu: Fix bug in rcu_barrier() torture test
The child threads in the rcu_torture_barrier_cbs() are improperly synchronized, which can cause the rcu_barrier() tests to hang. The failure mode is as follows: 1. CPU 0 running in rcu_torture_barrier() sets barrier_cbs_count to n_barrier_cbs. 2. CPU 1 running in rcu_torture_barrier_cbs() wakes up, posts its RCU callback, and atomically decrements barrier_cbs_count. Because barrier_cbs_count is not zero, it does not do the wake_up(). 3. CPU 2 running in rcu_torture_barrier_cbs() wakes up, but finds that barrier_cbs_count is not equal to n_barrier_cbs, and so returns to sleep. 4. The value of barrier_cbs_count therefore never reaches zero, which causes the test to hang. This commit therefore uses a phase variable to coordinate the test, preventing this scenario from occurring. Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'usr')
0 files changed, 0 insertions, 0 deletions