aboutsummaryrefslogtreecommitdiff
path: root/lib/mpi/mpiutil.c
diff options
context:
space:
mode:
authorBart Van Assche <[email protected]>2014-12-09 16:58:35 +0100
committerJens Axboe <[email protected]>2014-12-09 09:07:16 -0700
commitc38d185d4af12e8be63ca4b6745d99449c450f12 (patch)
tree7de590795fcaf4557a7c0e2dee3f73cedddd39a1 /lib/mpi/mpiutil.c
parent9e98e9d7cf6e9d2ec1cce45e8d5ccaf3f9b386f3 (diff)
blk-mq: Fix a race between bt_clear_tag() and bt_get()
What we need is the following two guarantees: * Any thread that observes the effect of the test_and_set_bit() by __bt_get_word() also observes the preceding addition of 'current' to the appropriate wait list. This is guaranteed by the semantics of the spin_unlock() operation performed by prepare_and_wait(). Hence the conversion of test_and_set_bit_lock() into test_and_set_bit(). * The wait lists are examined by bt_clear() after the tag bit has been cleared. clear_bit_unlock() guarantees that any thread that observes that the bit has been cleared also observes the store operations preceding clear_bit_unlock(). However, clear_bit_unlock() does not prevent that the wait lists are examined before that the tag bit is cleared. Hence the addition of a memory barrier between clear_bit() and the wait list examination. Signed-off-by: Bart Van Assche <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Robert Elliott <[email protected]> Cc: Ming Lei <[email protected]> Cc: Alexander Gordeev <[email protected]> Cc: <[email protected]> # v3.13+ Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'lib/mpi/mpiutil.c')
0 files changed, 0 insertions, 0 deletions