All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Roman Kagan <rkagan@virtuozzo.com>,
	"Denis V. Lunev" <den@openvz.org>,
	nbd-general@lists.sourceforge.net, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC 1/1] nbd (specification): add NBD_CMD_WRITE_ZEROES command
Date: Thu, 18 Feb 2016 09:35:47 -0700	[thread overview]
Message-ID: <56C5F2E3.1090102@redhat.com> (raw)
In-Reply-To: <20160218091857.GA12337@rkaganb.sw.ru>

[-- Attachment #1: Type: text/plain, Size: 2038 bytes --]

On 02/18/2016 02:18 AM, Roman Kagan wrote:
> On Wed, Feb 17, 2016 at 01:58:47PM -0700, Eric Blake wrote:
>> On 02/17/2016 11:10 AM, Denis V. Lunev wrote:
>>> @@ -446,6 +448,11 @@ The following request types exist:
>>>      about the contents of the export affected by this command, until
>>>      overwriting it again with `NBD_CMD_WRITE`.
>>>  
>>> +* `NBD_CMD_WRITE_ZEROES` (6)
>>> +
>>> +    A request to write zeroes. The command is functional equivalent of
>>> +    the NBD_WRITE_COMMAND but without payload sent through the channel.
>>
>> This lets us push holes during writes. Do we have the converse
>> operation, that is, an easy way to query if a block of data will read as
>> all zeroes, and therefore the client can bypass reading that portion of
>> the disk (in other words, an equivalent to lseek(SEEK_HOLE/SEEK_DATA))?
> 
> The spec doesn't have anything like that.
> 
> OTOH, unlike the write case, where you have all the information and just
> choose whether to send normal write or zero write, the extra round-trip
> of a separate SEEK_HOLE/SEEK_DATA request may lead to actually degrading
> the overall throughput.
> 
> Rather it may be a better idea to add something like sparse read where
> the server would, instead of sending the full length of data in the
> response payload, send a smarter variable-length package with a
> scatter-gather list or a bitmap of used blocks in the beginning, and let
> the client decode it and fill the gaps with zeros.

Sure, that would work too, and sounds nicer.  Either way, the point is
that we should strongly consider improving the NBD protocol to allow
more efficient handling of sparse files, in both the push and in the
pull direction.  Qemu already has a desire to use both directions of
improvements, but there are more programs, both clients and servers,
outside of qemu, that could benefit from such protocol improvements.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  parent reply	other threads:[~2016-02-18 16:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17 18:10 [Qemu-devel] [RFC 1/1] nbd (specification): add NBD_CMD_WRITE_ZEROES command Denis V. Lunev
2016-02-17 20:58 ` Eric Blake
2016-02-18  4:46   ` Denis V. Lunev
2016-02-18  8:30     ` Denis V. Lunev
2016-02-18  9:18   ` Roman Kagan
2016-02-18 10:36     ` Denis V. Lunev
2016-02-18 16:35     ` Eric Blake [this message]
2016-02-18 17:23       ` [Qemu-devel] SUMMARY: " Denis V. Lunev
2016-02-18 17:55         ` Eric Blake
2016-02-18 19:29         ` [Qemu-devel] [Nbd] " Alex Bligh
2016-02-19  7:12         ` [Qemu-devel] " Denis V. Lunev
2016-02-19  8:56           ` Vladimir Sementsov-Ogievskiy
2016-02-19  9:11           ` Daniel P. Berrange
2016-02-18 12:14   ` [Qemu-devel] " Daniel P. Berrange
2016-02-18 14:05     ` Denis V. Lunev
2016-02-18  8:09 ` Alex Bligh
2016-02-18  8:34   ` Denis V. Lunev
2016-03-04  8:49     ` [Qemu-devel] [Nbd] " Wouter Verhelst
2016-03-04  9:54       ` Kevin Wolf
2016-03-04 14:03         ` Paolo Bonzini
2016-03-06 10:28           ` Wouter Verhelst
2016-03-06 18:54             ` Denis V. Lunev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56C5F2E3.1090102@redhat.com \
    --to=eblake@redhat.com \
    --cc=den@openvz.org \
    --cc=nbd-general@lists.sourceforge.net \
    --cc=qemu-devel@nongnu.org \
    --cc=rkagan@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.