summaryrefslogtreecommitdiff
path: root/drivers/md/raid1.h
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2024-02-29 12:57:06 +0300
committerSong Liu <song@kernel.org>2024-03-01 09:49:45 +0300
commit2c27d09d3a76b33629d2e681bf8b774f776ade7f (patch)
tree522d44db48c73783e8e6e5dbb2e47629b920e380 /drivers/md/raid1.h
parent969d6589abcb369d53d84ec7c9c37f4b23ec1ad9 (diff)
downloadlinux-2c27d09d3a76b33629d2e681bf8b774f776ade7f.tar.xz
md/raid1: record nonrot rdevs while adding/removing rdevs to conf
For raid1, each read will iterate all the rdevs from conf and check if any rdev is non-rotational, then choose rdev with minimal IO inflight if so, or rdev with closest distance otherwise. Disk nonrot info can be changed through sysfs entry: /sys/block/[disk_name]/queue/rotational However, consider that this should only be used for testing, and user really shouldn't do this in real life. Record the number of non-rotational disks in conf, to avoid checking each rdev in IO fast path and simplify read_balance() a little bit. Co-developed-by: Paul Luse <paul.e.luse@linux.intel.com> Signed-off-by: Paul Luse <paul.e.luse@linux.intel.com> Signed-off-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Song Liu <song@kernel.org> Link: https://lore.kernel.org/r/20240229095714.926789-4-yukuai1@huaweicloud.com
Diffstat (limited to 'drivers/md/raid1.h')
-rw-r--r--drivers/md/raid1.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/raid1.h b/drivers/md/raid1.h
index 14d4211a123a..5300cbaa58a4 100644
--- a/drivers/md/raid1.h
+++ b/drivers/md/raid1.h
@@ -71,6 +71,7 @@ struct r1conf {
* allow for replacements.
*/
int raid_disks;
+ int nonrot_disks;
spinlock_t device_lock;