aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-mq-tag.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-12-08 10:49:06 -0500
committerJens Axboe <axboe@fb.com>2014-12-08 10:49:06 -0500
commit080ff3511450fd73948697fef34a3cc382675b59 (patch)
tree8ce40121a12ef2d48c0c094f3b3751069490a29b /block/blk-mq-tag.c
parentb32232073e8061b41258bff2a10a06a91677480a (diff)
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/blk-mq-tag.c')
-rw-r--r--block/blk-mq-tag.c8
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,
261 */ 261 */
262 blk_mq_run_hw_queue(hctx, false); 262 blk_mq_run_hw_queue(hctx, false);
263 263
264 /*
265 * Retry tag allocation after running the hardware queue,
266 * as running the queue may also have found completions.
267 */
268 tag = __bt_get(hctx, bt, last_tag);
269 if (tag != -1)
270 break;
271
264 blk_mq_put_ctx(data->ctx); 272 blk_mq_put_ctx(data->ctx);
265 273
266 io_schedule(); 274 io_schedule();