diff mbox series

[10/16] drbd: pass the max_hw_sectors limit to blk_alloc_disk

Message ID 20240226103004.281412-11-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [01/16] block: add a queue_limits_set helper | expand

Commit Message

Christoph Hellwig Feb. 26, 2024, 10:29 a.m. UTC
Pass a queue_limits structure with the max_hw_sectors limit to
blk_alloc_disk instead of updating the limit on the allocated gendisk.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/block/drbd/drbd_main.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Comments

Christoph Hellwig March 3, 2024, 3:14 p.m. UTC | #1
Dear RDBD maintainers,

can you start the review on the drbd queue limits conversion?
This is the only big chunk of the queue limits conversion we haven't
even started reviews on, and the merge window is closing soon.
Philipp Reisner March 4, 2024, 3:31 p.m. UTC | #2
Hi Christoph,

thanks for the heads up, and sorry for not seeing it sooner. We test
it overnight and review the patches tomorrow morning.


On Sun, Mar 3, 2024 at 4:14 PM Christoph Hellwig <hch@lst.de> wrote:
>
> Dear RDBD maintainers,
>
> can you start the review on the drbd queue limits conversion?
> This is the only big chunk of the queue limits conversion we haven't
> even started reviews on, and the merge window is closing soon.
>
Philipp Reisner March 5, 2024, 9:39 a.m. UTC | #3
Christoph,

we are fine with the queue limit conversion as you did it. Lars and I
reviewed it, and Christoph ran the tests. All fine.


On Mon, Mar 4, 2024 at 4:31 PM Philipp Reisner
<philipp.reisner@linbit.com> wrote:
>
> Hi Christoph,
>
> thanks for the heads up, and sorry for not seeing it sooner. We test
> it overnight and review the patches tomorrow morning.
>
>
> On Sun, Mar 3, 2024 at 4:14 PM Christoph Hellwig <hch@lst.de> wrote:
> >
> > Dear RDBD maintainers,
> >
> > can you start the review on the drbd queue limits conversion?
> > This is the only big chunk of the queue limits conversion we haven't
> > even started reviews on, and the merge window is closing soon.
> >
Christoph Hellwig March 5, 2024, 1:38 p.m. UTC | #4
On Tue, Mar 05, 2024 at 10:39:55AM +0100, Philipp Reisner wrote:
> Christoph,
> 
> we are fine with the queue limit conversion as you did it. Lars and I
> reviewed it, and Christoph ran the tests. All fine.

Can you provide formal Reviewed-by and Tested-by tags?  I'll resend the
patches standalone, maybe reply to those.
diff mbox series

Patch

diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index cea1e537fd56c1..113b441d4d3670 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -2690,6 +2690,14 @@  enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig
 	int id;
 	int vnr = adm_ctx->volume;
 	enum drbd_ret_code err = ERR_NOMEM;
+	struct queue_limits lim = {
+		/*
+		 * Setting the max_hw_sectors to an odd value of 8kibyte here.
+		 * This triggers a max_bio_size message upon first attach or
+		 * connect.
+		 */
+		.max_hw_sectors		= DRBD_MAX_BIO_SIZE_SAFE >> 8,
+	};
 
 	device = minor_to_device(minor);
 	if (device)
@@ -2708,7 +2716,7 @@  enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig
 
 	drbd_init_set_defaults(device);
 
-	disk = blk_alloc_disk(NULL, NUMA_NO_NODE);
+	disk = blk_alloc_disk(&lim, NUMA_NO_NODE);
 	if (IS_ERR(disk)) {
 		err = PTR_ERR(disk);
 		goto out_no_disk;
@@ -2729,9 +2737,6 @@  enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig
 
 	blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, disk->queue);
 	blk_queue_write_cache(disk->queue, true, true);
-	/* Setting the max_hw_sectors to an odd value of 8kibyte here
-	   This triggers a max_bio_size message upon first attach or connect */
-	blk_queue_max_hw_sectors(disk->queue, DRBD_MAX_BIO_SIZE_SAFE >> 8);
 
 	device->md_io.page = alloc_page(GFP_KERNEL);
 	if (!device->md_io.page)