]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: don't lose requests if a stopped queue restarts
authorShaohua Li <shli@fb.com>
Mon, 4 May 2015 20:32:48 +0000 (14:32 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 4 May 2015 20:32:48 +0000 (14:32 -0600)
commit78645119759b882c2921ec7bda56445644f0066d
treefbcac9cb92b6540370ee63bb4db3b466302fede3
parent1bd3760498d84b0921ca189ca982a62aa364b11e
blk-mq: don't lose requests if a stopped queue restarts

Normally if driver is busy to dispatch a request the logic is like below:
block layer: driver:
__blk_mq_run_hw_queue
a. blk_mq_stop_hw_queue
b. rq add to ctx->dispatch

later:
1. blk_mq_start_hw_queue
2. __blk_mq_run_hw_queue

But it's possible step 1-2 runs between a and b. And since rq isn't in
ctx->dispatch yet, step 2 will not run rq. The rq might get lost if
there are no subsequent requests kick in.

Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c