From: "Mohamed Abuelfotoh, Hazem" <abuehaze@amazon.com>
To: Jens Axboe <axboe@kernel.dk>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH] block: use plug request list tail for one-shot backmerge attempt
Date: Tue, 24 Jun 2025 11:45:52 +0100 [thread overview]
Message-ID: <d9d623e5-4247-4dce-9aaa-d78e1d648f10@amazon.com> (raw)
In-Reply-To: <f4ed489d-af31-4ca0-bfc1-a340034c61f5@kernel.dk>
On 11/06/2025 18:53, Jens Axboe wrote:
> Yes we can't revert it, and honestly I would not want to even if that
> was an option. If the multi-queue case is particularly important, you
> could just do something ala the below - keep scanning until you a merge
> _could_ have happened but didn't. Ideally we'd want to iterate the plug
> list backwards and then we could keep the same single shot logic, where
> you only attempt one request that has a matching queue. And obviously we
> could just doubly link the requests, there's space in the request
> linkage code to do that. But that'd add overhead in general, I think
> it's better to shove a bit of that overhead to the multi-queue case.
>
> I suspect the below would do the trick, however.
>
> diff --git a/block/blk-merge.c b/block/blk-merge.c
> index 70d704615be5..4313301f131c 100644
> --- a/block/blk-merge.c
> +++ b/block/blk-merge.c
> @@ -1008,6 +1008,8 @@ bool blk_attempt_plug_merge(struct request_queue *q, struct bio *bio,
> rq_list_for_each(&plug->mq_list, rq) {
> if (rq->q != q)
> continue;
> + if (blk_try_merge(rq, bio) == ELEVATOR_NO_MERGE)
> + continue;
> if (blk_attempt_bio_merge(q, rq, bio, nr_segs, false) ==
> BIO_MERGE_OK)
> return true;
>
> --
> Jens Axboe
Sorry for my delayed reply here as I was on business trip for the last
couple of weeks. I have done some testing on 6 SSDs aggregated as raid0
to simulate the multi-queue case but I haven't seen measurable impact
from that change at least on the random write test case. Looks like the
patch has been queued to 6.15 & 6.12 stable without this change so I
assume we are dropping it?
Kernel | fio (B.W MiB/sec) | I/O size (iostat)
-------------- +---------------------+--------------------
6.15.2 | 639 | 4KiB
6.15.2+patchv1 | 648 | 4KiB
6.15.2+patchv2 | 665 | 4KiB
--------------+----------------------+--------------------
Hazem
prev parent reply other threads:[~2025-06-24 10:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-11 14:53 [PATCH] block: use plug request list tail for one-shot backmerge attempt Jens Axboe
2025-06-11 16:55 ` Mohamed Abuelfotoh, Hazem
2025-06-11 17:53 ` Jens Axboe
2025-06-12 5:22 ` Christoph Hellwig
2025-06-12 5:23 ` Christoph Hellwig
2025-06-12 11:49 ` Jens Axboe
2025-06-12 11:56 ` Christoph Hellwig
2025-06-12 12:21 ` Jens Axboe
2025-06-12 12:23 ` Christoph Hellwig
2025-06-12 12:28 ` Jens Axboe
2025-06-16 13:11 ` Christoph Hellwig
2025-06-16 16:01 ` Caleb Sander Mateos
2025-06-17 2:36 ` Ming Lei
2025-06-17 4:39 ` Christoph Hellwig
2025-06-18 6:04 ` Hannes Reinecke
2025-06-12 12:27 ` Mohamed Abuelfotoh, Hazem
2025-06-24 10:45 ` Mohamed Abuelfotoh, Hazem [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d9d623e5-4247-4dce-9aaa-d78e1d648f10@amazon.com \
--to=abuehaze@amazon.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox