diff mbox

nbd: set the max segment size to UINT_MAX

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

Commit Message

Josef Bacik April 17, 2017, 1:44 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 | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jens Axboe April 17, 2017, 3:55 p.m. UTC | #1
On 04/17/2017 07:44 AM, 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.

Doesn't apply to the 4.12 branch.
Jens Axboe April 17, 2017, 3:57 p.m. UTC | #2
On 04/17/2017 09:55 AM, Jens Axboe wrote:
> On 04/17/2017 07:44 AM, 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.
> 
> Doesn't apply to the 4.12 branch.

Maybe it does on top of your previous series. I'll check.
Jens Axboe April 17, 2017, 3:59 p.m. UTC | #3
On 04/17/2017 09:57 AM, Jens Axboe wrote:
> On 04/17/2017 09:55 AM, Jens Axboe wrote:
>> On 04/17/2017 07:44 AM, 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.
>>
>> Doesn't apply to the 4.12 branch.
> 
> Maybe it does on top of your previous series. I'll check.

Nope, does not.
Josef Bacik April 17, 2017, 5:50 p.m. UTC | #4
> On Apr 17, 2017, at 11:59 AM, Jens Axboe <axboe@fb.com> wrote:
> 
> On 04/17/2017 09:57 AM, Jens Axboe wrote:
>> On 04/17/2017 09:55 AM, Jens Axboe wrote:
>>> On 04/17/2017 07:44 AM, 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.
>>> 
>>> Doesn't apply to the 4.12 branch.
>> 
>> Maybe it does on top of your previous series. I'll check.
> 
> Nope, does not.

Sorry I'll rebase onto the latest 4.12 branch, it was based on whatever 4.12 was two weeks ago + my nbd series.  Thanks,

Josef
Alex Bligh April 17, 2017, 9:46 p.m. UTC | #5
> On 17 Apr 2017, at 15:44, 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.

I'm a bit lost around the various knobs in the kernel for maximum block
sizes, but note that the NBD protocol is (with an extension, soon
to be made mainstream by the looks of it) capable of negotiating
block size minima, maxima and preferred sizes - see here:

https://github.com/NetworkBlockDevice/nbd/blob/extension-info/doc/proto.md#block-size-constraints

These are server block sizes (obviously) which would normally be passed
from userland client to kernel client via an ioctl. I suspect such
ioctls may not be implemented at the moment, and kernel support for
them would be much appreciated.
diff mbox

Patch

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index d220045..0f62d86 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1469,6 +1469,8 @@  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);
+
 	disk->queue->limits.discard_zeroes_data = 0;
 	blk_queue_max_hw_sectors(disk->queue, 65536);
 	disk->queue->limits.max_sectors = 256;