Omar Sandoval 4ace53f1ed sbitmap: use test_and_set_bit_lock()/clear_bit_unlock()
sbitmap_queue_get()/sbitmap_queue_clear() are used for
allocating/freeing a resource, so they should provide acquire/release
barrier semantics, respectively. sbitmap_get() currently contains a full
barrier, which is unnecessary, so use test_and_set_bit_lock() instead of
test_and_set_bit() (these are equivalent on x86_64). sbitmap_clear_bit()
does not imply any barriers, which is incorrect, as accesses of the
resource (e.g., request) could potentially get reordered to after the
clear_bit(). Introduce sbitmap_clear_bit_unlock() and use it for
sbitmap_queue_clear() (this only adds a compiler barrier on x86_64). The
other existing user of sbitmap_clear_bit() (the blk-mq software queue
pending map) is serialized through a spinlock and does not need this.

Reported-by: Tejun Heo <tj@kernel.org>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2018-02-28 12:23:35 -07:00
..
2017-12-22 19:39:09 +11:00
2017-08-15 09:02:08 -07:00
2017-12-01 13:09:40 -08:00
2017-12-01 13:09:40 -08:00
2015-11-23 09:44:58 +01:00
2017-12-01 13:09:40 -08:00
2018-02-06 18:32:44 -08:00
2018-01-01 12:40:27 -07:00
2018-02-06 18:32:44 -08:00
2017-10-07 10:45:14 -06:00
2017-02-24 17:46:57 -08:00
2018-02-21 15:35:43 -08:00
2017-11-17 16:10:01 -08:00
2018-01-31 11:32:27 -08:00
2018-02-06 18:32:47 -08:00
2018-02-01 10:00:28 -08:00
2017-12-01 13:09:40 -08:00
2017-12-01 13:09:40 -08:00
2016-12-06 10:17:03 +02:00
2018-02-21 15:35:43 -08:00
2018-01-15 09:35:50 +01:00
2018-01-09 16:33:31 +01:00
2017-12-01 13:09:40 -08:00
2017-08-15 09:02:07 -07:00