From: Bart Van Assche Date: Mon, 8 Dec 2014 15:46:34 +0000 (-0700) Subject: blk-mq: fix hang in bt_get() X-Git-Tag: v3.19-rc1~88^2~10 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=b32232073e8061b41258bff2a10a06a91677480a;p=~emulex%2Finfiniband.git 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 --- diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index 230ef3056b7..eb55492e687 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, if (tag != -1) break; + /* + * We're out of tags on this hardware queue, kick any + * pending IO submits before going to sleep waiting for + * some to complete. + */ + blk_mq_run_hw_queue(hctx, false); + blk_mq_put_ctx(data->ctx); io_schedule();