mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
synced 2025-11-02 03:40:21 +10:00
block: don't reorder requests in blk_add_rq_to_plug
commit e70c301fae upstream.
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 <hch@lst.de>
Link: https://lore.kernel.org/r/20241113152050.157179-6-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2ad0f19a4e
commit
7e2d224939
@ -1386,7 +1386,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++;
|
||||
}
|
||||
|
||||
@ -2840,7 +2840,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);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user