public inbox for linux-raid@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Yu Kuai <yukuai@fnnas.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	linux-raid@vger.kernel.org, linan122@huawei.com, xni@redhat.com,
	dan.carpenter@linaro.org,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH v5 07/12] md: support to align bio to limits
Date: Mon, 19 Jan 2026 00:27:01 -0800	[thread overview]
Message-ID: <aW3q1SnU4gN9Ahba@infradead.org> (raw)
In-Reply-To: <8b44bd64-efc8-428a-ad2f-9a9fcda786a1@fnnas.com>

On Mon, Jan 19, 2026 at 03:43:34PM +0800, Yu Kuai wrote:
> >> 64k boundary is still necessary for small IO.
> > What do you mean with "necessary for small IO"?
> 
> io_min and io_opt is quite similar in mdraid, IO aligned with io_opt
> can get the best bandwidth, and IO aligned with io_min can get the
> best iops. Currently chunk_sectors is the same as io_min, and
> bio_split_rw() will try to align IO to io_min. I don't think we want
> to remove this behavior.

I'm still confused.  Let's go back to your example:

32 disks raid5 array with chunksize=64k.

Let's look at writes first:

Each I/O that is full aligned to 31 * 64k can be handled without a
read-modify-write cycle, so splitting I/O at that boundary makes perfect
sense.  Below that there really should not me much difference, i.e.
splitting anything at the 64k boundary is not useful.  So you want the
chunk_sectors to apply at the 31 * 64k boundary, and the io_opt as well.
And probably io_min too. (all just looking at writes).

For non-degradead reads, not much should matter.   All reads should be
reasonably efficient, splitting 64k boundaries is going to make the
implementation trivial, but will make your rely heavily on plugging
below, and also means you use quite a lot of lower bios.

For degraded reads, each I/O will always read 31 * 64k.  Splitting at
31 * 64k makes the implementation much easier.

I guess you want different boundaries for reads and writes?

Note that io_opt and io_min really just are values for the caller and
not affect splitting decisions themselves.  Of course the underlying
factors should be related.

  reply	other threads:[~2026-01-19  8:27 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-14 17:12 [PATCH v5 00/12] md: align bio to io_opt for better performance Yu Kuai
2026-01-14 17:12 ` [PATCH v5 01/12] md/raid5: fix raid5_run() to return error when log_init() fails Yu Kuai
2026-01-15  1:28   ` Li Nan
2026-01-15  2:29   ` Xiao Ni
2026-01-16 15:05   ` Christoph Hellwig
2026-01-14 17:12 ` [PATCH v5 02/12] md: merge mddev has_superblock into mddev_flags Yu Kuai
2026-01-16 15:06   ` Christoph Hellwig
2026-01-18 11:30     ` Yu Kuai
2026-01-14 17:12 ` [PATCH v5 03/12] md: merge mddev faillast_dev " Yu Kuai
2026-01-14 17:12 ` [PATCH v5 04/12] md: merge mddev serialize_policy " Yu Kuai
2026-01-14 17:12 ` [PATCH v5 05/12] md/raid5: use mempool to allocate stripe_request_ctx Yu Kuai
2026-01-14 17:12 ` [PATCH v5 06/12] md/raid5: make sure max_sectors is not less than io_opt Yu Kuai
2026-01-14 17:12 ` [PATCH v5 07/12] md: support to align bio to limits Yu Kuai
2026-01-16 15:08   ` Christoph Hellwig
2026-01-18 11:40     ` Yu Kuai
2026-01-19  6:47       ` Christoph Hellwig
2026-01-19  7:21         ` Yu Kuai
2026-01-19  7:27           ` Christoph Hellwig
2026-01-19  7:43             ` Yu Kuai
2026-01-19  8:27               ` Christoph Hellwig [this message]
2026-01-19  9:15                 ` Yu Kuai
2026-01-14 17:12 ` [PATCH v5 08/12] md: add a helper md_config_align_limits() Yu Kuai
2026-01-14 17:12 ` [PATCH v5 09/12] md/raid5: align bio to io_opt Yu Kuai
2026-01-14 17:12 ` [PATCH v5 10/12] md/raid10: " Yu Kuai
2026-01-14 17:12 ` [PATCH v5 11/12] md/raid0: " Yu Kuai
2026-01-14 17:12 ` [PATCH v5 12/12] md: fix abnormal io_opt from member disks Yu Kuai
2026-01-16 15:08   ` Christoph Hellwig
2026-01-17  3:28     ` Coly Li
2026-01-19  6:48       ` Christoph Hellwig
2026-01-19  7:24         ` Yu Kuai
2026-01-19  8:36           ` Christoph Hellwig
2026-01-15 23:38 ` [PATCH v5 00/12] md: align bio to io_opt for better performance John Stoffel

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=aW3q1SnU4gN9Ahba@infradead.org \
    --to=hch@infradead.org \
    --cc=dan.carpenter@linaro.org \
    --cc=linan122@huawei.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=xni@redhat.com \
    --cc=yukuai@fnnas.com \
    /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