Re: [RFC PATCH 0/5] md/raid1: improve choose_best_rdev read balance

From: yu kuai

Date: Sun Oct 18 2026 - 01:57:39 EST


Hi,

在 2026/8/18 15:06, Chen Cheng 写道:
> From: Chen Cheng <chencheng@xxxxxxxxx>
>
> Prefer a nonrot disk when one can take the read. When pending is
> the same, use a real round-robin among the disks we may pick.

Please note that adding new atomic operations per IO is not acceptable, future
solutions should also try to kill all existed atomic operations as well.

And your solution seems break an important case that if small sequence IO are
issued to the same disk, they can be merged by blk plug. I don't see test result
for this case.

In fact, I'll prefer a simple solution, keep the sequence IO to same disk until
they can't be merged(by io_opt or hw_sectors), and choose next simply by rr. IO
work flow can be complicated, and I'll prefer the simplest solution with minimal
overhead.

>
> fio libaio direct=1, NVMe none, SATA mq-deadline (stock -> this):
>
> - 2x GM9000: 1M QD16 j1 7.031 -> 13.886 GB/s, 50/50; 4k QD1 50/50
> - 2x/3x HDWG740: 0.294 -> 0.514 / 0.630 GB/s
> - GM9000+HDD seq: 2.468 or 0.280 -> 7.112 GB/s, 100/0 NVMe
> - Fanxiang+HDD seq, HDD first: 0.278 -> 0.562 GB/s
> - GM9000+HDD 4k QD8/16: clat -47% / -45%
>
>
> Chen Cheng (5):
> md/raid1: balance reads across non-rotational disks
> md/raid1: do not move nonrot reads onto a rot disk
> md/raid1: do not send random reads to a rot disk
> md/raid1: use rot policy when no nonrot disk is readable
> md/raid1: clarify choose_best_rdev comments
>
> drivers/md/raid1.c | 122 ++++++++++++++++++++++++++++++++++++++-------
> drivers/md/raid1.h | 1 +
> 2 files changed, 104 insertions(+), 19 deletions(-)
>
--
Thanks,
Kuai