Attached are the patches I'm experimenting with. I'm not sure if I'm
missing something important.
The first patch is for the kernel. This adds two netlink attributes
NBD_ATTR_BLOCK_SIZE_{MIN,OPT} to set the minimum and preferred block
size respectively. These appear to work, the values are reflected in
/sys/devices/virtual/block/nbd0/queue/minimum_io_size,
/sys/devices/virtual/block/nbd0/queue/optimal_io_size and in blkid:
$ cat /sys/devices/virtual/block/nbd0/queue/minimum_io_size
16384
$ cat /sys/devices/virtual/block/nbd0/queue/optimal_io_size
65536
$ sudo blkid -i /dev/nbd0
/dev/nbd0: MINIMUM_IO_SIZE="16384" OPTIMAL_IO_SIZE="65536"
PHYSICAL_SECTOR_SIZE="512" LOGICAL_SECTOR_SIZE="512"
The second patch is for nbd and just hard-codes some values for
testing purposes.
The problem is that programs I've tried, including the kernel, don't
respect these values very much. Certainly mkfs and the kernel doesn't
seem to have a problem sending requests to the server which are
smaller than the minimum we requested. It's hard to tell if it really
has much effect or not.
BTW I only modified the netlink interface, not the ioctl interface.
Is it true that we've deprecated the ioctl interface to nbd.ko and
prefer the netlink interface?
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW