aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorSteven Johnson <[email protected]>2012-12-05 11:39:32 +0800
committerBrian Behlendorf <[email protected]>2012-12-05 12:23:40 -0800
commit9b88fa165f320d9fc19d965f0f918511fca460a9 (patch)
treec4cfcc505c7ce8d9b2f9e42675f688c192405471 /cmd
parent053678f3b0572db442551dfa547dea939f45c96b (diff)
splat taskq:front: Fix race
The taskq:front test has a race condition where task 4 and 8 race to complete, due to an incorrectly calculated set of delay "factors" (T). If task 4 wins and actually finishes first, the verification of the order of completion will fail. The delays calculated to order task completion do not take into account the terminal line in the table, and so are all off by a factor of 1. This causes all the tasks in all queues to finish sooner than expected and the accumulated error is the root cause of tasks 4 and 8 racing to complete first. Before the change the "actual" table looks like I commented in #130. I changed: * the table in the comment to correctly reflect the test and the factor timings needed. * the individual task delay factors of T so that ONLY 1 task will every 2T. (on average) * 1T was reduced from 100ms to 50ms. This halves the duration of the test and makes any remaining raciness more likely to cause failures, but it did not cause the test to fail. * simplified the delay factor logic by using a table look-up instead of a switch. * Added a "task started" message so that with -v it is possible to see the order tasks are started. * Moved the "task completed" message inside the spinlock so that with -v the message truly reflects the absolute order of completion as guaranteed by the spinlock. Signed-off-by: Brian Behlendorf <[email protected]> Closes #130
Diffstat (limited to 'cmd')
0 files changed, 0 insertions, 0 deletions