Re: [PATCH v5 07/12] md: support to align bio to limits
"Yu Kuai" <[email protected]>
| Newsgroups | gmane.linux.raid |
|---|---|
| Message-ID | <[email protected]> |
在 2026/1/19 15:27, Christoph Hellwig 写道: > On Mon, Jan 19, 2026 at 03:21:14PM +0800, Yu Kuai wrote: >> Hi, >> >> 在 2026/1/19 14:47, Christoph Hellwig 写道: >>> On Sun, Jan 18, 2026 at 07:40:23PM +0800, Yu Kuai wrote: >>>> No, the chunk_sectors and io_opt are different, and align io to io_opt >>>> is not a general idea, for now this is the only requirement in mdraid. >>> The chunk size was added for (hardware) devices that require I/O split at >>> a fixed granularity for performance reasons. Which seems to e exactly >>> what you want here. >>> >>> This has nothing to do with max_sectors. >> For example, 32 disks raid5 array with chunksize=64k, currently the queue >> limits are: >> >> chunk_sectors = 64k >> io_min = 64k >> io_opt = 64 * 31k >> max_sectors = 1M >> >> It's correct to split I/O at 64k boundary to avoid performance issues, however >> split at 64 *31k boundary is what we want to get best bandwidth. >> >> So, if we simply changes chunk_sectors to 64 * 31k, it will be incorrect, because >> 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. > -- Thansk, Kuai