diff options
author | Jens Axboe | 2014-12-08 16:49:06 +0100 |
---|---|---|
committer | Jens Axboe | 2014-12-08 16:49:06 +0100 |
commit | 080ff3511450fd73948697fef34a3cc382675b59 (patch) | |
tree | 8ce40121a12ef2d48c0c094f3b3751069490a29b /block | |
parent | blk-mq: fix hang in bt_get() (diff) | |
download | kernel-qcow2-linux-080ff3511450fd73948697fef34a3cc382675b59.tar.gz kernel-qcow2-linux-080ff3511450fd73948697fef34a3cc382675b59.tar.xz kernel-qcow2-linux-080ff3511450fd73948697fef34a3cc382675b59.zip |
blk-mq: re-check for available tags after running the hardware queue
If we run out of tags and have to sleep, we run the hardware queue
to kick pending IO into gear. During that run, we may have completed
requests, so re-check if we have free tags before going to sleep.
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-mq-tag.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index eb55492e6875..bab4bff15f42 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -261,6 +261,14 @@ static int bt_get(struct blk_mq_alloc_data *data, */ blk_mq_run_hw_queue(hctx, false); + /* + * Retry tag allocation after running the hardware queue, + * as running the queue may also have found completions. + */ + tag = __bt_get(hctx, bt, last_tag); + if (tag != -1) + break; + blk_mq_put_ctx(data->ctx); io_schedule(); |