[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Nbd] /sys/block/nbd*/queue/max_hw_sectors_kb low value



Hi there,

using vanilla nbd-kmod makes it currently impossible to raise
max_sectors_kb for nbd devices as max_hw_sectors_kb is hardcoded to 127.
The following change to nbd.c makes it possible to increase the value up
to 32767, but also changes the default of max_sectors_kb to 512, which
is the default for most of other block queues.
Not only this helps to run fair performance comparisions agains raw disk
devices, but make the default 4K aligned, which is a good thing IMHO...

@@ -856,6 +860,7 @@
                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, 65535);
        }
 
        if (register_blkdev(NBD_MAJOR, "nbd")) {

Perhaps raising the max_hw_sectors_kb to this high value but setting the
default for max_sectors_kb to 128 would be even better...

Please consider pushing it upstream.
Thanks!

-- 
Michal Belczyk Sr.



Reply to: