From: Michal Belczyk Date: Wed, 17 Apr 2013 23:49:14 +0000 (+1000) Subject: nbd: increase default and max request sizes X-Git-Tag: next-20130422~1^2~95 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=17fc7a80d2c534d35546c03c3a8352490a1459fc;p=karo-tx-linux.git nbd: increase default and max request sizes Raise the default max request size for nbd to 128KB (from 127KB) to get it 4KB aligned. This patch also allows the max request size to be increased (via /sys/block/nbd/queue/max_sectors_kb) to 32MB. The patch makes nbd network traffic more efficient by: - reducing request fragmentation (4KB alignment) - reducing the number of requests (fewer round trips, less network overhead) Especially in high latency networks, larger request size can make a dramatic Signed-off-by: Paul Clements Signed-off-by: Michal Belczyk Cc: Jens Axboe Signed-off-by: Andrew Morton --- diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 7fecc784be01..037288e7874d 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -856,6 +856,8 @@ static int __init nbd_init(void) disk->queue->limits.discard_granularity = 512; disk->queue->limits.max_discard_sectors = UINT_MAX; disk->queue->limits.discard_zeroes_data = 0; + blk_queue_max_hw_sectors(disk->queue, 65536); + disk->queue->limits.max_sectors = 256; } if (register_blkdev(NBD_MAJOR, "nbd")) {