On 06/16/2016 04:10 AM, Stefan Hajnoczi wrote: > > io_sectors currently only accounts for bytes written, not bytes read. > > Therefore, I think we need: > > /* Don't charge for efficient zero writes */ > if (drv->bdrv_co_pwrite_zeroes) { > io_sectors = 0; > }
That's not sufficient. NBD will have conditional support for write zeroes, depending on whether the server supports it (that is, once my patches for NBD_CMD_WRITE_ZEROES get out of a holding pattern on all the other patches in the queue being flushed...). So NBD will have the bdrv_co_pwrite_zeroes callback, but that doesn't mean it will always work - if the server doesn't support it, calling bdrv_co_pwrite_zeroes will fail with -ENOTSUP and fall back to less-efficient writes that need to be accounted for. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature