aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2014-12-08 10:46:34 -0500
committerJens Axboe <axboe@fb.com>2014-12-08 10:46:34 -0500
commitb32232073e8061b41258bff2a10a06a91677480a (patch)
tree5cf6507cccea99afd291e0274c205c6474895881 /block
parent6637fadf25657e619a50fde5ff3ae09a98d20eb5 (diff)
blk-mq: fix hang in bt_get()
Avoid that if there are fewer hardware queues than CPU threads that bt_get() can hang. The symptoms of the hang were as follows: * All tags allocated for a particular hardware queue. * (nr_tags) pending commands for that hardware queue. * No pending commands for the software queues associated with that hardware queue. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq-tag.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index 230ef3056b72..eb55492e6875 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -254,6 +254,13 @@ static int bt_get(struct blk_mq_alloc_data *data,
254 if (tag != -1) 254 if (tag != -1)
255 break; 255 break;
256 256
257 /*
258 * We're out of tags on this hardware queue, kick any
259 * pending IO submits before going to sleep waiting for
260 * some to complete.
261 */
262 blk_mq_run_hw_queue(hctx, false);
263
257 blk_mq_put_ctx(data->ctx); 264 blk_mq_put_ctx(data->ctx);
258 265
259 io_schedule(); 266 io_schedule();