Richard W.M. Jones
2022-Jan-30 09:10 UTC
[Libguestfs] [PATCH libnbd] copy: Implement destination preferred block size
On Sun, Jan 30, 2022 at 12:45:37AM +0200, Nir Soffer wrote:> On Fri, Jan 28, 2022 at 10:37 PM Richard W.M. Jones <rjones at redhat.com> wrote: > > + .get_preferred_block_size = nbd_ops_get_preferred_block_size, > > Why preferred block size and not minimum block size? For example if we > write 256k when the minimum block size is 64k, wouldn't qemu block layer > handle the write properly, creating 4 compressed clusters?My theory was that if the destination prefers a particular block size, and we're going to all this effort anyway, we might as well use the preference. For the qcow2/compress filter the two values are identical.> When not using a compress filter, qemu-nbd reports block size of 4k, and > using this value it will kill performance.Not sure I understand? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Nir Soffer
2022-Jan-30 16:18 UTC
[Libguestfs] [PATCH libnbd] copy: Implement destination preferred block size
On Sun, Jan 30, 2022 at 11:10 AM Richard W.M. Jones <rjones at redhat.com> wrote:> > On Sun, Jan 30, 2022 at 12:45:37AM +0200, Nir Soffer wrote: > > On Fri, Jan 28, 2022 at 10:37 PM Richard W.M. Jones <rjones at redhat.com> wrote: > > > + .get_preferred_block_size = nbd_ops_get_preferred_block_size, > > > > Why preferred block size and not minimum block size? For example if we > > write 256k when the minimum block size is 64k, wouldn't qemu block layer > > handle the write properly, creating 4 compressed clusters? > > My theory was that if the destination prefers a particular block size, > and we're going to all this effort anyway, we might as well use the > preference. For the qcow2/compress filter the two values are > identical. > > > When not using a compress filter, qemu-nbd reports block size of 4k, and > > using this value it will kill performance. > > Not sure I understand?I think this was a mistake - if we use the preferred size only for alignment, not for limiting the size of the requests, it should be ok to use the preferred block size.