All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Kevin Wolf <kwolf@redhat.com>, Wouter Verhelst <w@uter.be>
Cc: nbd-general@lists.sourceforge.net, qemu-devel@nongnu.org,
	den@openvz.org, pborzenkov@virtuozzo.com, stefanha@redhat.com,
	mpa@pengutronix.de, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [Nbd] [PATCH v3] doc: Add NBD_CMD_BLOCK_STATUS extension
Date: Tue, 29 Nov 2016 14:34:25 +0300	[thread overview]
Message-ID: <29678de1-20d5-4ba4-9f01-2dbaae159ff8@virtuozzo.com> (raw)
In-Reply-To: <20161129101839.GA7080@noname.redhat.com>

29.11.2016 13:18, Kevin Wolf wrote:
> Am 27.11.2016 um 20:17 hat Wouter Verhelst geschrieben:
>>> 3. Q: selecting of dirty bitmap to export
>>>     A: several variants:
>>>        1: id of bitmap is in flags field of request
>>>            pros: - simple
>>>            cons: - it's a hack. flags field is for other uses.
>>>                  - we'll have to map bitmap names to these "ids"
>>>        2: introduce extended nbd requests with variable length and exploit this
>>>           feature for BLOCK_STATUS command, specifying bitmap identifier.
>>>           pros: - looks like a true way
>>>           cons: - we have to create additional extension
>>>                 - possible we have to create a map,
>>>                   {<QEMU bitmap name> <=> <NBD bitmap id>}
>>>        3: exteranl tool should select which bitmap to export. So, in case of Qemu
>>>           it should be something like qmp command block-export-dirty-bitmap.
>>>           pros: - simple
>>>                 - we can extend it to behave like (2) later
>>>           cons: - additional qmp command to implement (possibly, the lesser evil)
>>>           note: Hmm, external tool can make chose between allocated/dirty data too,
>>>                 so, we can remove 'NBD_FLAG_STATUS_DIRTY' flag at all.
>> Downside of 3, though, is that it moves the definition of what the
>> different states mean outside of the NBD protocol (i.e., the protocol
>> messages are not entirely defined anymore, and their meaning depends on
>> the clients and servers in use).
> Another point to consider is that option 3 doesn't allow you to access
> two (or more) different bitmaps from the client without using the side
> channel all the time to switch back and forth between them and having to
> drain the request queue each time to avoid races.
>
> In general, if we have something that "looks like the true way", I'd
> advocate to choose this option. Experience tells that we'd regret
> anything simpler in a year or two, and then we'll have to do the real
> thing anyway, but still need to support the quick hack for
> compatibility.
>
>>> 5. Number of status descriptors, sent by server, should be restricted
>>>     variants:
>>>     1: just allow server to restrict this as it wants (which was done in v3)
>>>     2: (not excluding 1). Client specifies somehow the maximum for number
>>>        of descriptors.
>>>        2.1: add command flag, which will request only one descriptor
>>>             (otherwise, no restrictions from the client)
>>>        2.2: again, introduce extended nbd requests, and add field to
>>>             specify this maximum
>> I think having a flag which requests just one descriptor can be useful,
>> but I'm hesitant to add it unless it's actually going to be used; so in
>> other words, I'll leave the decision on that bit to you.
> The native qemu block layer interface returns the status of only one
> contiguous chunks, so the easiest way to implement the NBD block driver
> in qemu would always use that bit.
>
> On the other hand, it would be possible for the NBD block driver in qemu
> to cache the rest of the response internally and answer the next request
> from the cache instead of sending a new request over the network. Maybe
> that's what it should be doing anyway for good performance.
>
>>> Also, an idea on 2-4:
>>>
>>>      As we say, that dirtiness is unknown for NBD, and external tool
>>>      should specify, manage and understand, which data is actually
>>>      transmitted, why not just call it user_data and leave status field
>>>      of reply chunk unspecified in this case?
>>>
>>>      So, I propose one flag for NBD_CMD_BLOCK_STATUS:
>>>      NBD_FLAG_STATUS_USER. If it is clear, than behaviour is defined by
>>>      Eric's 'Block provisioning status' paragraph.  If it is set, we just
>>>      leave status field for some external... protocol? Who knows, what is
>>>      this user data.
>> Yes, this sounds like a reasonable approach.
> Makes sense to me, too.
>
> However, if we have use for a single NBD_FLAG_STATUS_USER bit, we also
> have use for a second one. If we go with one of the options where the
> bitmap is selected per command, we're fine because you can simply move
> the second bit to a different bitmap and do two requests. If we have
> only a single active bitmap at a time, though, this feels like an actual
> problem.
>
>>> Another idea, about backups themselves:
>>>
>>>      Why do we need allocated/zero status for backup? IMHO we don't.
>> Well, I've been thinking so all along, but then I don't really know what
>> it is, in detail, that you want to do :-)
> I think we do. A block can be dirtied by discarding/write_zero-ing it.
> Then we want the dirty bit to know that we need to include this block in
> the incremental backup, but we also want to know that we don't actually
> have to transfer the data in it.

And we will know that automatically, by using structured read command, 
so separate call to get_block_status is not needed.

>
> Kevin


-- 
Best regards,
Vladimir

  reply	other threads:[~2016-11-29 11:34 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-25 11:28 [Qemu-devel] [PATCH v3] doc: Add NBD_CMD_BLOCK_STATUS extension Vladimir Sementsov-Ogievskiy
2016-11-25 14:02 ` Stefan Hajnoczi
2016-11-27 19:17 ` [Qemu-devel] [Nbd] " Wouter Verhelst
2016-11-28 11:19   ` Stefan Hajnoczi
2016-11-28 17:33     ` Wouter Verhelst
2016-11-29  9:17       ` Stefan Hajnoczi
2016-11-29 10:50       ` Wouter Verhelst
2016-11-29 12:41         ` Vladimir Sementsov-Ogievskiy
2016-11-29 13:08           ` Wouter Verhelst
2016-11-29 13:07         ` Alex Bligh
2016-12-01 10:14         ` Wouter Verhelst
2016-12-01 11:26           ` Vladimir Sementsov-Ogievskiy
2016-12-02  9:25             ` Wouter Verhelst
2016-11-28 23:15   ` John Snow
2016-11-29 10:18   ` Kevin Wolf
2016-11-29 11:34     ` Vladimir Sementsov-Ogievskiy [this message]
2016-11-30 10:41   ` Sergey Talantov
2016-11-29 12:57 ` [Qemu-devel] " Alex Bligh
2016-11-29 14:36   ` Vladimir Sementsov-Ogievskiy
2016-11-29 14:52     ` Alex Bligh
2016-11-29 15:07       ` Vladimir Sementsov-Ogievskiy
2016-11-29 15:17         ` [Qemu-devel] [Nbd] " Wouter Verhelst
2016-12-01 23:42   ` [Qemu-devel] " John Snow
2016-12-02  9:16     ` Vladimir Sementsov-Ogievskiy
2016-12-02 18:45     ` Alex Bligh
2016-12-02 20:39       ` John Snow
2016-12-03 11:08         ` Alex Bligh
2016-12-05  8:36         ` Vladimir Sementsov-Ogievskiy
2016-12-06 13:32         ` [Qemu-devel] [Nbd] " Wouter Verhelst
2016-12-06 16:39           ` John Snow
2016-12-08  3:39       ` [Qemu-devel] " Alex Bligh
2016-12-08  6:58         ` Vladimir Sementsov-Ogievskiy
2016-12-08 14:13           ` Alex Bligh
2016-12-08  9:44         ` [Qemu-devel] [Nbd] " Wouter Verhelst
2016-12-08 14:40           ` Alex Bligh
2016-12-08 15:59             ` Eric Blake
2016-12-08 16:03               ` Alex Bligh

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=29678de1-20d5-4ba4-9f01-2dbaae159ff8@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=kwolf@redhat.com \
    --cc=mpa@pengutronix.de \
    --cc=nbd-general@lists.sourceforge.net \
    --cc=pbonzini@redhat.com \
    --cc=pborzenkov@virtuozzo.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 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.