diff options
author | Ming Lei <ming.lei@redhat.com> | 2018-04-04 19:35:21 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-04-10 17:38:46 +0300 |
commit | 0bca799b92807ee9be0890690f5dde7d8c6a8e25 (patch) | |
tree | 4d12bfe71c3a9427fe33db8aeba49fc1c76a62cb /mm/kasan | |
parent | 052c220da392c4dcbc628852d04970447a315683 (diff) | |
download | linux-0bca799b92807ee9be0890690f5dde7d8c6a8e25.tar.xz |
blk-mq: order getting budget and driver tag
This patch orders getting budget and driver tag by making sure to acquire
driver tag after budget is got, this way can help to avoid the following
race:
1) before dispatch request from scheduler queue, get one budget first, then
dequeue a request, call it request A.
2) in another IO path for dispatching request B which is from hctx->dispatch,
driver tag is got, then try to get budget in blk_mq_dispatch_rq_list(),
unfortunately the budget is held by request A.
3) meantime blk_mq_dispatch_rq_list() is called for dispatching request
A, and try to get driver tag first, unfortunately no driver tag is
available because the driver tag is held by request B
4) both two IO pathes can't move on, and IO stall is caused.
This issue can be observed when running dbench on USB storage.
This patch fixes this issue by always getting budget before getting
driver tag.
Cc: stable@vger.kernel.org
Fixes: de1482974080ec9e ("blk-mq: introduce .get_budget and .put_budget in blk_mq_ops")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Omar Sandoval <osandov@fb.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'mm/kasan')
0 files changed, 0 insertions, 0 deletions