[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251124063203.1692144-9-yukuai@fnnas.com>
Date: Mon, 24 Nov 2025 14:32:00 +0800
From: Yu Kuai <yukuai@...as.com>
To: song@...nel.org,
linux-raid@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
filippo@...ian.org,
colyli@...as.com,
yukuai@...as.com
Subject: [PATCH v2 08/11] md/raid5: align bio to io_opt
raid5 internal implementaion indicates that if write bio is aligned to
io_opt, then full stripe write will be used, which will be best for
bandwidth because there is no need to read extra data to build new
xor data.
Simple test in my VM, 32 disks raid5 with 64kb chunksize:
dd if=/dev/zero of=/dev/md0 bs=100M oflag=direct
Before this patch: 782 MB/s
With this patch: 1.1 GB/s
BTW, there are still other bottleneck related to stripe handler, and
require further optimization.
Signed-off-by: Yu Kuai <yukuai@...as.com>
---
drivers/md/raid5.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 0b607aa5963e..bbcb1c06951c 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -59,8 +59,7 @@
#define UNSUPPORTED_MDDEV_FLAGS \
((1L << MD_FAILFAST_SUPPORTED) | \
(1L << MD_FAILLAST_DEV) | \
- (1L << MD_SERIALIZE_POLICY) | \
- (1L << MD_BIO_ALIGN))
+ (1L << MD_SERIALIZE_POLICY))
#define cpu_to_group(cpu) cpu_to_node(cpu)
@@ -7814,8 +7813,7 @@ static int raid5_set_limits(struct mddev *mddev)
* Limit the max sectors based on this.
*/
lim.max_hw_sectors = RAID5_MAX_REQ_STRIPES << RAID5_STRIPE_SHIFT(conf);
- if ((lim.max_hw_sectors << 9) < lim.io_opt)
- lim.max_hw_sectors = lim.io_opt >> 9;
+ md_config_align_limits(mddev, &lim);
/* No restrictions on the number of segments in the request */
lim.max_segments = USHRT_MAX;
--
2.51.0
Powered by blists - more mailing lists