From: Christoph Hellwig <hch@lst.de>
To: "Philipp Reisner" <philipp.reisner@linbit.com>,
"Lars Ellenberg" <lars.ellenberg@linbit.com>,
"Christoph Böhmwalder" <christoph.boehmwalder@linbit.com>,
"Jens Axboe" <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, drbd-dev@lists.linbit.com
Subject: [PATCH 1/7] drbd: pass the max_hw_sectors limit to blk_alloc_disk
Date: Tue, 5 Mar 2024 06:40:35 -0700 [thread overview]
Message-ID: <20240305134041.137006-2-hch@lst.de> (raw)
In-Reply-To: <20240305134041.137006-1-hch@lst.de>
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(-)
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)
--
2.39.2
next prev parent reply other threads:[~2024-03-05 13:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-05 13:40 drbd atomic queue limits conversion Christoph Hellwig
2024-03-05 13:40 ` Christoph Hellwig [this message]
2024-03-05 13:40 ` [PATCH 2/7] drbd: refactor drbd_reconsider_queue_parameters Christoph Hellwig
2024-03-05 13:40 ` [PATCH 3/7] drbd: refactor the backing dev max_segments calculation Christoph Hellwig
2024-03-05 13:40 ` [PATCH 4/7] drbd: merge drbd_setup_queue_param into drbd_reconsider_queue_parameters Christoph Hellwig
2024-03-05 13:40 ` [PATCH 5/7] drbd: don't set max_write_zeroes_sectors in decide_on_discard_support Christoph Hellwig
2024-03-05 13:40 ` [PATCH 6/7] drbd: split out a drbd_discard_supported helper Christoph Hellwig
2024-03-05 13:40 ` [PATCH 7/7] drbd: atomically update queue limits in drbd_reconsider_queue_parameters Christoph Hellwig
2024-03-06 14:03 ` [PATCH 0/7] drbd atomic queue limits conversion Philipp Reisner
2024-03-06 15:35 ` Jens Axboe
2024-03-06 14:03 ` [PATCH 1/7] drbd: pass the max_hw_sectors limit to blk_alloc_disk Philipp Reisner
2024-03-06 14:03 ` [PATCH 2/7] drbd: refactor drbd_reconsider_queue_parameters Philipp Reisner
2024-03-06 14:03 ` [PATCH 3/7] drbd: refactor the backing dev max_segments calculation Philipp Reisner
2024-03-06 14:03 ` [PATCH 4/7] drbd: merge drbd_setup_queue_param into drbd_reconsider_queue_parameters Philipp Reisner
2024-03-06 14:03 ` [PATCH 5/7] drbd: don't set max_write_zeroes_sectors in decide_on_discard_support Philipp Reisner
2024-03-06 14:03 ` [PATCH 6/7] drbd: split out a drbd_discard_supported helper Philipp Reisner
2024-03-06 14:03 ` [PATCH 7/7] drbd: atomically update queue limits in drbd_reconsider_queue_parameters Philipp Reisner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240305134041.137006-2-hch@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=christoph.boehmwalder@linbit.com \
--cc=drbd-dev@lists.linbit.com \
--cc=lars.ellenberg@linbit.com \
--cc=linux-block@vger.kernel.org \
--cc=philipp.reisner@linbit.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox