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>
This commit is contained in:
Bart Van Assche 2014-12-08 08:46:34 -07:00 коммит произвёл Jens Axboe
Родитель 6637fadf25
Коммит b32232073e
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -254,6 +254,13 @@ static int bt_get(struct blk_mq_alloc_data *data,
if (tag != -1) if (tag != -1)
break; 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); blk_mq_put_ctx(data->ctx);
io_schedule(); io_schedule();