diff options
author | Yu Kuai <yukuai3@huawei.com> | 2024-02-29 17:57:06 +0800 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2024-02-29 22:49:45 -0800 |
commit | 2c27d09d3a76b33629d2e681bf8b774f776ade7f (patch) | |
tree | 522d44db48c73783e8e6e5dbb2e47629b920e380 /drivers/md/md.h | |
parent | 969d6589abcb369d53d84ec7c9c37f4b23ec1ad9 (diff) | |
download | linux-stable-2c27d09d3a76b33629d2e681bf8b774f776ade7f.tar.gz linux-stable-2c27d09d3a76b33629d2e681bf8b774f776ade7f.tar.bz2 linux-stable-2c27d09d3a76b33629d2e681bf8b774f776ade7f.zip |
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/md.h')
-rw-r--r-- | drivers/md/md.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index a49ab04ab707..b2076a165c10 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -207,6 +207,7 @@ enum flag_bits { * check if there is collision between raid1 * serial bios. */ + Nonrot, /* non-rotational device (SSD) */ }; static inline int is_badblock(struct md_rdev *rdev, sector_t s, int sectors, |