diff mbox

nbd: set the max segment size to UINT_MAX

Message ID 1492546971-2682-1-git-send-email-jbacik@fb.com (mailing list archive)
State New, archived
Headers show

Commit Message

Josef Bacik April 18, 2017, 8:22 p.m. UTC
NBD doesn't care about limiting the segment size, let the user push the
largest bio's they want.  This allows us to control the request size
solely through max_sectors_kb.

Signed-off-by: Josef Bacik <jbacik@fb.com>
---
 drivers/block/nbd.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Ming Lei April 19, 2017, 12:54 a.m. UTC | #1
On Wed, Apr 19, 2017 at 4:22 AM, Josef Bacik <josef@toxicpanda.com> wrote:
> NBD doesn't care about limiting the segment size, let the user push the
> largest bio's they want.  This allows us to control the request size
> solely through max_sectors_kb.
>
> Signed-off-by: Josef Bacik <jbacik@fb.com>
> ---
>  drivers/block/nbd.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
> index b78f23c..6e592c2 100644
> --- a/drivers/block/nbd.c
> +++ b/drivers/block/nbd.c
> @@ -1469,6 +1469,7 @@ static int nbd_dev_add(int index)
>         queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, disk->queue);
>         disk->queue->limits.discard_granularity = 512;
>         blk_queue_max_discard_sectors(disk->queue, UINT_MAX);
> +       blk_queue_max_segment_size(disk->queue, UINT_MAX);
>         blk_queue_max_hw_sectors(disk->queue, 65536);
>         disk->queue->limits.max_sectors = 256;

The change is fine, since the segment size limit should be from hw itself.

Reviewed-by: Ming Lei <ming.lei@redhat.com>

Thanks,
Ming Lei
Jens Axboe April 19, 2017, 2:16 p.m. UTC | #2
On 04/18/2017 02:22 PM, Josef Bacik wrote:
> NBD doesn't care about limiting the segment size, let the user push the
> largest bio's they want.  This allows us to control the request size
> solely through max_sectors_kb.

Thanks Josef, applied for 4.12.
diff mbox

Patch

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index b78f23c..6e592c2 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1469,6 +1469,7 @@  static int nbd_dev_add(int index)
 	queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, disk->queue);
 	disk->queue->limits.discard_granularity = 512;
 	blk_queue_max_discard_sectors(disk->queue, UINT_MAX);
+	blk_queue_max_segment_size(disk->queue, UINT_MAX);
 	blk_queue_max_hw_sectors(disk->queue, 65536);
 	disk->queue->limits.max_sectors = 256;