From 225f2e16adb301d24bbda7630ba151616ab7e82e Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 13 Nov 2024 16:20:46 +0100 Subject: [PATCH] UPSTREAM: block: don't reorder requests in blk_mq_add_to_batch LIFO ordering for batched completions is a bit unexpected and also defeats some merging optimizations in e.g. the XFS buffered write code. Now that we can easily add the request to the tail of the list do that. Change-Id: I7d756bdcff026c7a01814fbeb6f5dc239999dd51 Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20241113152050.157179-7-hch@lst.de Signed-off-by: Jens Axboe Bug: 415836627 (cherry picked from commit 00e8d290b55f2fa5c5a0500b4dccf9e090650447) Signed-off-by: Bart Van Assche --- include/linux/blk-mq.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 64003cec6566..374e8639539a 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -920,7 +920,7 @@ static inline bool blk_mq_add_to_batch(struct request *req, else if (iob->complete != complete) return false; iob->need_ts |= blk_mq_need_time_stamp(req); - rq_list_add_head(&iob->req_list, req); + rq_list_add_tail(&iob->req_list, req); return true; }