mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
blk-mq-sched: add framework for MQ capable IO schedulers
This adds a set of hooks that intercepts the blk-mq path of allocating/inserting/issuing/completing requests, allowing us to develop a scheduler within that framework. We reuse the existing elevator scheduler API on the registration side, but augment that with the scheduler flagging support for the blk-mq interfce, and with a separate set of ops hooks for MQ devices. We split driver and scheduler tags, so we can run the scheduling independently of device queue depth. Signed-off-by: Jens Axboe <axboe@fb.com> Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Omar Sandoval <osandov@fb.com>
This commit is contained in:
parent
2af8cbe305
commit
bd166ef183
17 changed files with 983 additions and 193 deletions
|
@ -22,6 +22,7 @@ struct blk_mq_hw_ctx {
|
|||
|
||||
unsigned long flags; /* BLK_MQ_F_* flags */
|
||||
|
||||
void *sched_data;
|
||||
struct request_queue *queue;
|
||||
struct blk_flush_queue *fq;
|
||||
|
||||
|
@ -35,6 +36,7 @@ struct blk_mq_hw_ctx {
|
|||
atomic_t wait_index;
|
||||
|
||||
struct blk_mq_tags *tags;
|
||||
struct blk_mq_tags *sched_tags;
|
||||
|
||||
struct srcu_struct queue_rq_srcu;
|
||||
|
||||
|
@ -156,6 +158,7 @@ enum {
|
|||
|
||||
BLK_MQ_S_STOPPED = 0,
|
||||
BLK_MQ_S_TAG_ACTIVE = 1,
|
||||
BLK_MQ_S_SCHED_RESTART = 2,
|
||||
|
||||
BLK_MQ_MAX_DEPTH = 10240,
|
||||
|
||||
|
@ -179,13 +182,13 @@ void blk_mq_free_tag_set(struct blk_mq_tag_set *set);
|
|||
|
||||
void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule);
|
||||
|
||||
void blk_mq_insert_request(struct request *, bool, bool, bool);
|
||||
void blk_mq_free_request(struct request *rq);
|
||||
bool blk_mq_can_queue(struct blk_mq_hw_ctx *);
|
||||
|
||||
enum {
|
||||
BLK_MQ_REQ_NOWAIT = (1 << 0), /* return when out of requests */
|
||||
BLK_MQ_REQ_RESERVED = (1 << 1), /* allocate from reserved pool */
|
||||
BLK_MQ_REQ_INTERNAL = (1 << 2), /* allocate internal/sched tag */
|
||||
};
|
||||
|
||||
struct request *blk_mq_alloc_request(struct request_queue *q, int rw,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue