Skip to content

Commit b270509

Browse files
Chengkaitaokawasaki
authored andcommitted
mq-deadline: the dd->dispatch queue follows a FIFO policy
In the initial implementation, the 'list_add(&rq->queuelist, ...' statement added to the dd_insert_request function was designed to differentiate priorities among various IO-requests within the same linked list. For example, 'Commit 945ffb6 ("mq-deadline: add blk-mq adaptation of the deadline IO scheduler")', introduced this 'list_add' operation to ensure that requests with the at_head flag would always be dispatched before requests without the REQ_TYPE_FS flag. Since 'Commit 7687b38 ("bfq/mq-deadline: remove redundant check for passthrough request")', removed blk_rq_is_passthrough, the dd->dispatch list now contains only requests with the at_head flag. In this context, all at_head requests should be treated as having equal priority, and a first-in-first-out (FIFO) policy better aligns with the current situation. Therefore, replacing list_add with list_add_tail is more appropriate. Signed-off-by: Chengkaitao <chengkaitao@kylinos.cn>
1 parent ec9caac commit b270509

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/mq-deadline.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
661661
trace_block_rq_insert(rq);
662662

663663
if (flags & BLK_MQ_INSERT_AT_HEAD) {
664-
list_add(&rq->queuelist, &dd->dispatch);
664+
list_add_tail(&rq->queuelist, &dd->dispatch);
665665
rq->fifo_time = jiffies;
666666
} else {
667667
deadline_add_rq_rb(per_prio, rq);

0 commit comments

Comments
 (0)