]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: use sbq wait queues instead of restart for driver tags
authorOmar Sandoval <osandov@fb.com>
Wed, 22 Feb 2017 18:58:29 +0000 (10:58 -0800)
committerJens Axboe <axboe@fb.com>
Thu, 23 Feb 2017 18:55:46 +0000 (11:55 -0700)
commitf01e3c7777b7bf4931544a3742a937a1a8a5594a
tree59e8fea4c15519bfd0cfed355f59bf30d5d8e03d
parentebdcc991210b0caba08e19f62607590a74d98af1
blk-mq: use sbq wait queues instead of restart for driver tags

Commit a4b4d6acc559 ("blk-mq-sched: fix starvation for multiple hardware
queues and shared tags") fixed one starvation issue for shared tags.
However, we can still get into a situation where we fail to allocate a
tag because all tags are allocated but we don't have any pending
requests on any hardware queue.

One solution for this would be to restart all queues that share a tag
map, but that really sucks. Ideally, we could just block and wait for a
tag, but that isn't always possible from blk_mq_dispatch_rq_list().

However, we can still use the struct sbitmap_queue wait queues with a
custom callback instead of blocking. This has a few benefits:

1. It avoids iterating over all hardware queues when completing an I/O,
   which the current restart code has to do.
2. It benefits from the existing rolling wakeup code.
3. It avoids punting to another thread just to have it block.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c
include/linux/blk-mq.h