UPSTREAM: 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. Change-Id: I88fd46d132b38c012c6273c54ba0f6af062b8197 Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20241113152050.157179-6-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk> Bug: 415836627 (cherry picked from commit e70c301faece15b618e54b613b1fd6ece3dd05b4) Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
committed by
Carlos Llamas
parent
24f685a927
commit
bdcd6a28fd
@@ -1388,7 +1388,7 @@ static void blk_add_rq_to_plug(struct blk_plug *plug, struct request *rq)
|
||||
*/
|
||||
if (!plug->has_elevator && (rq->rq_flags & RQF_SCHED_TAGS))
|
||||
plug->has_elevator = true;
|
||||
rq_list_add_head(&plug->mq_list, rq);
|
||||
rq_list_add_tail(&plug->mq_list, rq);
|
||||
plug->rq_count++;
|
||||
}
|
||||
|
||||
@@ -2860,7 +2860,7 @@ static void blk_mq_dispatch_plug_list(struct blk_plug *plug, bool from_sched)
|
||||
rq_list_add_tail(&requeue_list, rq);
|
||||
continue;
|
||||
}
|
||||
list_add(&rq->queuelist, &list);
|
||||
list_add_tail(&rq->queuelist, &list);
|
||||
depth++;
|
||||
} while (!rq_list_empty(&plug->mq_list));
|
||||
|
||||
|
||||
@@ -514,7 +514,7 @@ static void virtio_queue_rqs(struct rq_list *rqlist)
|
||||
vq = this_vq;
|
||||
|
||||
if (virtblk_prep_rq_batch(req))
|
||||
rq_list_add_head(&submit_list, req); /* reverse order */
|
||||
rq_list_add_tail(&submit_list, req);
|
||||
else
|
||||
rq_list_add_tail(&requeue_list, req);
|
||||
}
|
||||
|
||||
@@ -1026,7 +1026,7 @@ static void nvme_queue_rqs(struct rq_list *rqlist)
|
||||
nvmeq = req->mq_hctx->driver_data;
|
||||
|
||||
if (nvme_prep_rq_batch(nvmeq, req))
|
||||
rq_list_add_head(&submit_list, req); /* reverse order */
|
||||
rq_list_add_tail(&submit_list, req);
|
||||
else
|
||||
rq_list_add_tail(&requeue_list, req);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user