]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid10: read balance chooses idlest disk for SSD
authorGuoqing Jiang <gqjiang@suse.com>
Fri, 14 Jun 2019 22:41:11 +0000 (15:41 -0700)
committerJens Axboe <axboe@kernel.dk>
Sat, 15 Jun 2019 07:37:35 +0000 (01:37 -0600)
commite2c4c79d36a12cf6b0826de610d5e0d8d93b72ba
treea11ec9c1ea3aa524798929a38158667a81218c3e
parent6a37ae74f15e41db1945f3d98a2bd1ba80d6fda2
md/raid10: read balance chooses idlest disk for SSD

Andy reported that raid10 array with SSD disks has poor
read performance. Compared with raid1, RAID-1 can be 3x
faster than RAID-10 sometimes [1].

The thing is that raid10 chooses the low distance disk
for read request, however, the approach doesn't work
well for SSD device since it doesn't have spindle like
HDD, we should just read from the SSD which has less
pending IO like commit ce2c7b1e077ae ("md/raid1: read
balance chooses idlest disk for SSD").

So this commit selects the idlest SSD disk for read if
array has none rotational disk, otherwise, read_balance
uses the previous distance priority algorithm. With the
change, the performance of raid10 gets increased largely
per Andy's test [2].

[1]. https://marc.info/?l=linux-raid&m=155915890004761&w=2
[2]. https://marc.info/?l=linux-raid&m=155990654223786&w=2

Tested-by: Andy Smith <andy@strugglers.net>
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/raid10.c