blk-mq: first cut deadline scheduling

Option for per-hw queue or all hw queue scheduling. Some rough edges
around restart of queue(s) that need to be looked at some more.
Additionally, it probably makes sense to track which queues should be
restarted, so we don't just blindly restart all of them. This could
unify ATOM_RESTART and ATOM_RESTART_ALL to be the same operation,
since both would look at what queues to restart.

Current tracking is done utilizing the blk-mq tag iterators. Both
queued and started requests are accounted for. We don't dispatch a
request if older requests haven't been dispatched yet.

When queueing is invoked, we always dispatch (at least) one request.
This may violate deadlines slightly. Currently this is done to avoid
further complicating the restart logic. Right now we know that a queue
will dispatch at least one request, if restarted and has requests
pending.

sysfs attributes are currently per-hw queue, should probably tie them
together for some of the cases.

It does read vs write deadlines, not sync vs async. Could make that
an option.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 files changed