Thread (3 messages) 3 messages, 2 authors, 2017-02-23

Re: [PATCH v3 1/2] blk-mq: use sbq wait queues instead of restart for driver tags

From: Jens Axboe <axboe@fb.com>
Date: 2017-02-23 18:56:22

On 02/22/2017 11:58 AM, Omar Sandoval wrote:
From: Omar Sandoval <redacted>

Commit 50e1dab86aa2 ("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.
Applied 1-2, thanks Omar.

-- 
Jens Axboe
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help