Skip to contentSkip to conversation

nbd: increase default and max request sizes

PATCH In review Paul Clements 2 participants 2 messages Apr 2, 2013 – Apr 11, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nbd: increase default and max request sizes

This patch raises 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<x>/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 difference in performance.

From: Michal Belczyk <[email protected]>

---

 nbd.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/block/nbd.c +2 -0
index 7fecc78..037288e 100644
@@ -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")) {
#1 lore raw
Quoted 8 lines · On Tue, 2 Apr 2013 15:41:20 -0400 (EDT) Paul Clements…

This patch raises 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<x>/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)

Quoted 5 lines

Especially in high latency networks, larger request size can make a dramatic difference in performance.

From: Michal Belczyk <[email protected]>

This is a bit odd.

- The author's "From:" line shouild appear right at the start of the changelog.

- Michal's Signed-off-by: is absent. Is one available?

Thanks.