From: Logan Gunthorpe Date: Thu, 16 Jun 2022 19:19:45 +0000 (-0600) Subject: md/raid5: Increase restriction on max segments per request X-Git-Tag: baikal/aarch64/sdk6.1~3362^2~107 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=6f8fa641c1cdf207040c180ec3ddc69bc7a64f49;p=kernel.git md/raid5: Increase restriction on max segments per request The block layer defaults the maximum segments to 128, which means requests tend to get split around the 512KB depending on how many pages can be merged. There's no such restriction in the raid5 code so increase the limit to USHRT_MAX so that larger requests can be sent as one. Signed-off-by: Logan Gunthorpe Signed-off-by: Song Liu Signed-off-by: Jens Axboe --- diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 651a84bf1a132..00cab9e525f19 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -8008,6 +8008,9 @@ static int raid5_run(struct mddev *mddev) */ blk_queue_max_hw_sectors(mddev->queue, RAID5_MAX_REQ_STRIPES << RAID5_STRIPE_SHIFT(conf)); + + /* No restrictions on the number of segments in the request */ + blk_queue_max_segments(mddev->queue, USHRT_MAX); } if (log_init(conf, journal_dev, raid5_has_ppl(conf)))