Skip to content

Commit

Permalink
md/raid5: Increase restriction on max segments per request
Browse files Browse the repository at this point in the history
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 <logang@deltatee.com>
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
lsgunth authored and axboe committed Aug 2, 2022
1 parent df1b620 commit 9ad1a74
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 9ad1a74

Please sign in to comment.