From: Pavel Borzenkov <pborzenkov@virtuozzo.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: nbd-general@lists.sourceforge.net,
"Denis V. Lunev" <den@openvz.org>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>, Wouter Verhelst <w@uter.be>
Subject: Re: [Qemu-devel] [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension
Date: Thu, 24 Mar 2016 11:25:52 +0300 [thread overview]
Message-ID: <20160324082552.GB24831@phobos.sw.ru> (raw)
In-Reply-To: <20160323181454.GI4126@noname.redhat.com>
On Wed, Mar 23, 2016 at 07:14:54PM +0100, Kevin Wolf wrote:
> Am 23.03.2016 um 18:58 hat Wouter Verhelst geschrieben:
> > On Wed, Mar 23, 2016 at 05:16:02PM +0300, Denis V. Lunev wrote:
> > > + The type of information required by the client is passed to server in the
> > > + command flags field. If the server does not implement requested type or
> > > + have no means to express it, it MUST NOT return an error, but instead MUST
> > > + return a single LBA status descriptor with *offset* and *length* equal to
> > > + the *offset* and *length* from request, and *status* set to `0`.
> > > +
> > > + The following request types are currently defined for the command:
> > > +
> > > + 1. Block provisioning state
> > > +
> > > + Upon receiving an `NBD_CMD_GET_LBA_STATUS` command with command flags
> > > + field set to `NBD_FLAG_GET_ALLOCATED` (0x0), the server MUST return
> >
> > I prefer to have a non-zero flag value.
> >
> > > + the provisioning state of the device. The following provisionnig states
> > > + are defined for the command:
> > > +
> > > + - `NBD_STATE_ALLOCATED` (0x0), LBA extent is present on the block device;
> > > + - `NBD_STATE_ZEROED` (0x1), LBA extent is present on the block device
> > > + and contains zeroes;
> >
> > Presumably this should be "contains only zeroes"?
> >
> > Also, this may end up being a fairly expensive call for the server to
> > process. Is it really useful?
>
> I think we need to make clear that this is meant as an optimisation and
> it's always a valid option for a server to return NBD_STATE_ALLOCATED
> even if the contents is zeroed.
>
> It is definitely useful if the server has a means to efficiently find
> out the allocation status (e.g. SEEK_HOLE). In that case the client may
> be able to avoid reading the block and sending it over the network, or
> when making a copy, it could use it to keep the target file sparse. If
> the client can't take advantage, we didn't have much overhead, so it's
> fine.
Yes, that was the idea. I'll add a note that the server may return
NBD_STATE_ALLOCATED instead of NBD_STATE_ZEROED if it has not means to
efficiently differentiate allocated blocks with zeroes from allocated
blocks with non-zeroed content.
>
> It's less clear in a case where the server needs to read in the block
> and scan its contents. It could still be a net win if the next thing the
> client does is retrieving the block: The server would still have the
> cost of reading the block, but it wouldn't be transferred. But when the
> client doesn't follow up with a read, it's quite a bit of overhead that
> we had for no benefit. Returning NBD_STATE_ALLOCATED might be more
> appropriate in this case than scanning for zeros.
>
> Kevin
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
> _______________________________________________
> Nbd-general mailing list
> Nbd-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nbd-general
next prev parent reply other threads:[~2016-03-24 8:41 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-23 14:16 [Qemu-devel] [PATCH 0/2] NBD protocol extensions: WRITE_ZEROES and GET_LBA_STATUS Denis V. Lunev
2016-03-23 14:16 ` [Qemu-devel] [PATCH 1/2] NBD proto: add WRITE_ZEROES extension Denis V. Lunev
2016-03-23 15:14 ` Eric Blake
2016-03-23 17:40 ` [Qemu-devel] [Nbd] " Wouter Verhelst
2016-03-24 7:16 ` [Qemu-devel] " Pavel Borzenkov
2016-03-24 7:36 ` [Qemu-devel] [Nbd] " Wouter Verhelst
2016-03-23 17:21 ` Wouter Verhelst
2016-03-24 7:57 ` Pavel Borzenkov
2016-03-24 8:26 ` Wouter Verhelst
2016-03-24 11:35 ` Pavel Borzenkov
2016-03-24 11:37 ` Paolo Bonzini
2016-03-24 12:31 ` Wouter Verhelst
2016-03-24 14:53 ` Eric Blake
2016-03-23 14:16 ` [Qemu-devel] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension Denis V. Lunev
2016-03-23 16:27 ` Eric Blake
2016-03-24 12:30 ` Pavel Borzenkov
2016-03-24 15:04 ` Eric Blake
2016-03-24 16:36 ` Pavel Borzenkov
2016-03-23 17:58 ` [Qemu-devel] [Nbd] " Wouter Verhelst
2016-03-23 18:14 ` Kevin Wolf
2016-03-24 8:25 ` Pavel Borzenkov [this message]
2016-03-24 8:41 ` Wouter Verhelst
2016-03-24 11:36 ` Pavel Borzenkov
2016-03-24 12:32 ` Wouter Verhelst
2016-03-24 8:43 ` Pavel Borzenkov
2016-03-24 9:33 ` Wouter Verhelst
2016-03-24 10:32 ` Alex Bligh
2016-03-24 11:58 ` Paolo Bonzini
2016-03-24 12:17 ` Alex Bligh
2016-03-24 12:32 ` Paolo Bonzini
2016-03-24 13:31 ` Alex Bligh
2016-03-24 13:32 ` Paolo Bonzini
2016-03-24 11:55 ` Paolo Bonzini
2016-03-24 12:43 ` Wouter Verhelst
2016-03-24 15:25 ` Eric Blake
2016-03-24 15:33 ` Paolo Bonzini
2016-03-24 15:53 ` Wouter Verhelst
2016-03-24 16:04 ` Eric Blake
2016-03-24 16:07 ` Kevin Wolf
2016-03-24 16:47 ` Wouter Verhelst
2016-03-29 9:38 ` Kevin Wolf
2016-03-29 9:53 ` Wouter Verhelst
2016-03-29 10:25 ` Paolo Bonzini
2016-03-24 22:08 ` [Qemu-devel] " Eric Blake
2016-03-25 8:49 ` [Qemu-devel] [Nbd] " Wouter Verhelst
2016-03-25 9:01 ` Alex Bligh
2016-03-28 15:58 ` Eric Blake
2016-04-04 10:32 ` Markus Pargmann
2016-04-04 10:18 ` Markus Pargmann
2016-04-04 16:54 ` Eric Blake
2016-04-04 22:17 ` Wouter Verhelst
2016-04-04 16:40 ` [Qemu-devel] " Eric Blake
2016-04-04 20:16 ` Denis V. Lunev
2016-04-04 20:36 ` [Qemu-devel] [Nbd] " Eric Blake
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=20160324082552.GB24831@phobos.sw.ru \
--to=pborzenkov@virtuozzo.com \
--cc=den@openvz.org \
--cc=kwolf@redhat.com \
--cc=nbd-general@lists.sourceforge.net \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=w@uter.be \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).