Skip to content

Commit e70c301

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: don't reorder requests in blk_add_rq_to_plug
Add requests to the tail of the list instead of the front so that they are queued up in submission order. Remove the re-reordering in blk_mq_dispatch_plug_list, virtio_queue_rqs and nvme_queue_rqs now that the list is ordered as expected. Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent a3396b9 commit e70c301

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

block/blk-mq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ static void blk_add_rq_to_plug(struct blk_plug *plug, struct request *rq)
13921392
*/
13931393
if (!plug->has_elevator && (rq->rq_flags & RQF_SCHED_TAGS))
13941394
plug->has_elevator = true;
1395-
rq_list_add_head(&plug->mq_list, rq);
1395+
rq_list_add_tail(&plug->mq_list, rq);
13961396
plug->rq_count++;
13971397
}
13981398

@@ -2844,7 +2844,7 @@ static void blk_mq_dispatch_plug_list(struct blk_plug *plug, bool from_sched)
28442844
rq_list_add_tail(&requeue_list, rq);
28452845
continue;
28462846
}
2847-
list_add(&rq->queuelist, &list);
2847+
list_add_tail(&rq->queuelist, &list);
28482848
depth++;
28492849
} while (!rq_list_empty(&plug->mq_list));
28502850

drivers/block/virtio_blk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ static void virtio_queue_rqs(struct rq_list *rqlist)
514514
vq = this_vq;
515515

516516
if (virtblk_prep_rq_batch(req))
517-
rq_list_add_head(&submit_list, req); /* reverse order */
517+
rq_list_add_tail(&submit_list, req);
518518
else
519519
rq_list_add_tail(&requeue_list, req);
520520
}

drivers/nvme/host/pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ static void nvme_queue_rqs(struct rq_list *rqlist)
945945
nvmeq = req->mq_hctx->driver_data;
946946

947947
if (nvme_prep_rq_batch(nvmeq, req))
948-
rq_list_add_head(&submit_list, req); /* reverse order */
948+
rq_list_add_tail(&submit_list, req);
949949
else
950950
rq_list_add_tail(&requeue_list, req);
951951
}

0 commit comments

Comments
 (0)