diff mbox series

[v3,15/15] md/raid5: Increase restriction on max segments per request

Message ID 20220616191945.23935-16-logang@deltatee.com (mailing list archive)
State Accepted, archived
Headers show
Series Improve Raid5 Lock Contention | expand

Commit Message

Logan Gunthorpe June 16, 2022, 7:19 p.m. UTC
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>
---
 drivers/md/raid5.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Finlayson, James M CIV (USA) June 16, 2022, 9:32 p.m. UTC | #1
Innocent question from position of ignorance....I see these last 15 check-ins all as performance improvements.   I tend to push hard on mdraid performance, but have RAID6 needs....are these some optimizations available for RAID6 and are they in process or did I just ask a silly question?

Regards,
Jim Finlayson
US Department of Defense

-----Original Message-----
From: Logan Gunthorpe <logang@deltatee.com> 
Sent: Thursday, June 16, 2022 3:20 PM
To: linux-kernel@vger.kernel.org; linux-raid@vger.kernel.org; Song Liu <song@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>; Guoqing Jiang <guoqing.jiang@linux.dev>; Stephen Bates <sbates@raithlin.com>; Martin Oliveira <Martin.Oliveira@eideticom.com>; David Sloan <David.Sloan@eideticom.com>; Logan Gunthorpe <logang@deltatee.com>
Subject: [Non-DoD Source] [PATCH v3 15/15] 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 <logang@deltatee.com>
---
 drivers/md/raid5.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index e48c16bfe657..5723a497108a 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -8005,6 +8005,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)))
--
2.30.2
Logan Gunthorpe June 16, 2022, 9:35 p.m. UTC | #2
On 2022-06-16 15:32, Finlayson, James M CIV (USA) wrote:
> Innocent question from position of ignorance....I see these last 15 check-ins all as performance improvements.   I tend to push hard on mdraid performance, but have RAID6 needs....are these some optimizations available for RAID6 and are they in process or did I just ask a silly question?

Yes, the optimizations in this series should improve raid6 performance
in the exact same way.

Raid6 and Raid5 share the same implementation. They are both
(confusingly) in the raid5.c file.

Logan
diff mbox series

Patch

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index e48c16bfe657..5723a497108a 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -8005,6 +8005,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)))