Re: [PATCH v5 07/12] md: support to align bio to limits

"Yu Kuai" <[email protected]>
Newsgroups gmane.linux.raid
Message-ID <[email protected]>
Hi,

在 2026/1/19 16:27, Christoph Hellwig 写道:
> 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).

This sounds reasonable, however, I'm not 100% sure split at 64k boundary
is not useful, I must run some tests to confirm. This behavior exist for
quite a long time.

>
> 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.

Correct, BTW, even if we don't split at 64k boundary in bio_split_rw(), raid5
will stil try to split at 64k boundary in chunk_aligned_read(), and this do
rely hevily on plugging below.

BTW, current plug limit really is too low for huge array, like 32+ member disks,
only 32 requests and at most 128k per request. However, I still can't find better
solution other than simply increase the limits.

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

I don't feel this is correct, each I/O will be handled by stripes, so a
4k read to the removed disk will only need to read 4k from other disks.
Anyway, this does not matter.

>
> I guess you want different boundaries for reads and writes?

Yes, this is still a potential demand, I'll test and take a detailed look
at other personalities.

>
> 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.

Thanks for the explanation, I'll feedback soon after testing.

-- 
Thansk,
Kuai
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.