Re: [RFC PATCH 0/2] use larger max_request_size for virtio_blk
2018-04-05 22:29 GMT+08:00 Jens Axboe: > On 4/5/18 4:09 AM, Weiping Zhang wrote: >> Hi, >> >> For virtio block device, actually there is no a hard limit for max request >> size, and virtio_blk driver set -1 to blk_queue_max_hw_sectors(q, -1U);. >> But it doesn't work, because there is a default upper limitation >> BLK_DEF_MAX_SECTORS (1280 sectors). So this series want to add a new helper >> blk_queue_max_hw_sectors_no_limit to set a proper max reqeust size. >> >> Weiping Zhang (2): >> blk-setting: add new helper blk_queue_max_hw_sectors_no_limit >> virtio_blk: add new module parameter to set max request size >> >> block/blk-settings.c | 20 >> drivers/block/virtio_blk.c | 32 ++-- >> include/linux/blkdev.h | 2 ++ >> 3 files changed, 52 insertions(+), 2 deletions(-) > > The driver should just use blk_queue_max_hw_sectors() to set the limit, > and then the soft limit can be modified by a udev rule. Technically the > driver doesn't own the software limit, it's imposed to ensure that we > don't introduce too much latency per request. > > Your situation is no different from many other setups, where the > hw limit is much higher than the default 1280k. > Hi Martin, Jens, It seems more reasonable to change software limitation by udev rule, thanks you. > > ___ > Virtualization mailing list > Virtualization@lists.linux-foundation.org > https://lists.linuxfoundation.org/mailman/listinfo/virtualization ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [RFC PATCH 0/2] use larger max_request_size for virtio_blk
On 4/5/18 4:09 AM, Weiping Zhang wrote: > Hi, > > For virtio block device, actually there is no a hard limit for max request > size, and virtio_blk driver set -1 to blk_queue_max_hw_sectors(q, -1U);. > But it doesn't work, because there is a default upper limitation > BLK_DEF_MAX_SECTORS (1280 sectors). So this series want to add a new helper > blk_queue_max_hw_sectors_no_limit to set a proper max reqeust size. > > Weiping Zhang (2): > blk-setting: add new helper blk_queue_max_hw_sectors_no_limit > virtio_blk: add new module parameter to set max request size > > block/blk-settings.c | 20 > drivers/block/virtio_blk.c | 32 ++-- > include/linux/blkdev.h | 2 ++ > 3 files changed, 52 insertions(+), 2 deletions(-) The driver should just use blk_queue_max_hw_sectors() to set the limit, and then the soft limit can be modified by a udev rule. Technically the driver doesn't own the software limit, it's imposed to ensure that we don't introduce too much latency per request. Your situation is no different from many other setups, where the hw limit is much higher than the default 1280k. -- Jens Axboe ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [RFC PATCH 0/2] use larger max_request_size for virtio_blk
Weiping, > For virtio block device, actually there is no a hard limit for max > request size, and virtio_blk driver set -1 to > blk_queue_max_hw_sectors(q, -1U);. But it doesn't work, because there > is a default upper limitation BLK_DEF_MAX_SECTORS (1280 sectors). That's intentional (although it's an ongoing debate what the actual value should be). > So this series want to add a new helper > blk_queue_max_hw_sectors_no_limit to set a proper max reqeust size. BLK_DEF_MAX_SECTORS is a kernel default empirically chosen to strike a decent balance between I/O latency and bandwidth. It sets an upper bound for filesystem requests only. Regardless of the capabilities of the block device driver and underlying hardware. You can override the limit on a per-device basis via max_sectors_kb in sysfs. People generally do it via a udev rule. -- Martin K. Petersen Oracle Linux Engineering ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization