qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: "Denis V. Lunev" <den@openvz.org>
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org, mreitz@redhat.com,
	armbru@redhat.com, eblake@redhat.com, jsnow@redhat.com,
	famz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v15 08/25] block: introduce auto-loading bitmaps
Date: Mon, 20 Feb 2017 13:23:29 +0100	[thread overview]
Message-ID: <20170220122329.GC4814@noname.redhat.com> (raw)
In-Reply-To: <72b9788d-e85d-b20d-b334-fe63154ba20d@openvz.org>

Am 20.02.2017 um 12:21 hat Denis V. Lunev geschrieben:
> On 02/20/2017 12:15 PM, Kevin Wolf wrote:
> > Am 18.02.2017 um 11:54 hat Denis V. Lunev geschrieben:
> >> On 02/17/2017 03:54 PM, Vladimir Sementsov-Ogievskiy wrote:
> >>> 17.02.2017 17:24, Kevin Wolf wrote:
> >>>> Am 17.02.2017 um 14:48 hat Denis V. Lunev geschrieben:
> >>>>> On 02/17/2017 04:34 PM, Kevin Wolf wrote:
> >>>>>> Am 17.02.2017 um 14:22 hat Denis V. Lunev geschrieben:
> >>>>>>> But for sure this is bad from the downtime point of view.
> >>>>>>> On migrate you will have to write to the image and re-read
> >>>>>>> it again on the target. This would be very slow. This will
> >>>>>>> not help for the migration with non-shared disk too.
> >>>>>>>
> >>>>>>> That is why we have specifically worked in a migration,
> >>>>>>> which for a good does not influence downtime at all now.
> >>>>>>>
> >>>>>>> With a write we are issuing several write requests + sync.
> >>>>>>> Our measurements shows that bdrv_drain could take around
> >>>>>>> a second on an averagely loaded conventional system, which
> >>>>>>> seems unacceptable addition to me.
> >>>>>> I'm not arguing against optimising migration, I fully agree with
> >>>>>> you. I
> >>>>>> just think that we should start with a correct if slow base version
> >>>>>> and
> >>>>>> then add optimisation to that, instead of starting with a broken base
> >>>>>> version and adding to that.
> >>>>>>
> >>>>>> Look, whether you do the expensive I/O on open/close and make that a
> >>>>>> slow operation or whether you do it on invalidate_cache/inactivate
> >>>>>> doesn't really make a difference in term of slowness because in
> >>>>>> general
> >>>>>> both operations are called exactly once. But it does make a difference
> >>>>>> in terms of correctness.
> >>>>>>
> >>>>>> Once you do the optimisation, of course, you'll skip writing those
> >>>>>> bitmaps that you transfer using a different channel, no matter whether
> >>>>>> you skip it in bdrv_close() or in bdrv_inactivate().
> >>>>>>
> >>>>>> Kevin
> >>>>> I do not understand this point as in order to optimize this
> >>>>> we will have to create specific code path or option from
> >>>>> the migration code and keep this as an ugly kludge forever.
> >>>> The point that I don't understand is why it makes any difference for the
> >>>> follow-up migration series whether the writeout is in bdrv_close() or
> >>>> bdrv_inactivate(). I don't really see the difference between the two
> >>>> from a migration POV; both need to be skipped if we transfer the bitmap
> >>>> using a different channel.
> >>>>
> >>>> Maybe I would see the reason if I could find the time to look at the
> >>>> migration patches first, but unfortunately I don't have this time at the
> >>>> moment.
> >>>>
> >>>> My point is just that generally we want to have a correctly working qemu
> >>>> after every single patch, and even more importantly after every series.
> >>>> As the migration series is separate from this, I don't think it's a good
> >>>> excuse for doing worse than we could easily do here.
> >>>>
> >>>> Kevin
> >>> With open/close all is already ok - bitmaps will not be saved because
> >>> of BDRV_O_INACTIVE  and will not be loaded because of IN_USE.
> > If the contents of so-called persistent bitmaps is lost across
> > migration and stale after bdrv_invalidate_cache, that's not "all ok" in
> > my book. It's buggy.
> >
> >> in any case load/store happens outside of VM downtime.
> >> The target is running at the moment of close on source,
> >> the source is running at the moment of open on target.
> > Which makes the operation in open/close meaningless: open reads data
> > which may still by changed, and close cannot write to the image any more
> > because ownership is already given up.
> >
> > Anyway, all of this isn't really productive. Please, can't you just
> > answer that simple question that I asked you above: What problems would
> > you get if you used invalidate_cache/inactivate instead of open/close
> > for triggering these actions?
> >
> > If you can bring up some "this would break X", "it would be very hard to
> > implement Y correctly then" or "in scenario Z, this would have unwanted
> > effects", then we can figure out what to do. But not putting things in
> > the proper place just because you don't feel like it isn't a very strong
> > argument.
> >
> > Kevin
> This will increase the downtime ~0.5-1 second for migrated VM

True before the optimisation is applied. But correctness trumps
speed.

> or will require very intrusive interface from migration code to
> here to avoid bitmap save for inactivation on that path.

You already have a (very implicit) interface from migration code to
bdrv_open/close. It consists of what Vladimir mentioned above: The
BDRV_O_INACTIVE and IN_USE flags, which happen to be in the right state
during migration so that they can be abused for controlling the
handover.

If moving the code means that we end up getting a more explicit
interface, that's actually a plus for me.

Kevin

  parent reply	other threads:[~2017-02-20 12:23 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15 10:10 [Qemu-devel] [PATCH v15 00/25] qcow2: persistent dirty bitmaps Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 01/25] specs/qcow2: fix bitmap granularity qemu-specific note Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 02/25] specs/qcow2: do not use wording 'bitmap header' Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 03/25] hbitmap: improve dirty iter Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 04/25] tests: add hbitmap iter test Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 05/25] block: fix bdrv_dirty_bitmap_granularity signature Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 06/25] block/dirty-bitmap: add deserialize_ones func Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 07/25] qcow2: add bitmaps extension Vladimir Sementsov-Ogievskiy
2017-02-16 11:14   ` Kevin Wolf
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 08/25] block: introduce auto-loading bitmaps Vladimir Sementsov-Ogievskiy
2017-02-16 11:25   ` Kevin Wolf
2017-02-16 11:49     ` Kevin Wolf
2017-02-17 11:46       ` Vladimir Sementsov-Ogievskiy
2017-02-17 12:09         ` Kevin Wolf
2017-02-17 12:40           ` Vladimir Sementsov-Ogievskiy
2017-02-17 12:48             ` Kevin Wolf
2017-02-17 13:22               ` Denis V. Lunev
2017-02-17 13:34                 ` Kevin Wolf
2017-02-17 13:48                   ` Denis V. Lunev
2017-02-17 14:24                     ` Kevin Wolf
2017-02-17 14:54                       ` Vladimir Sementsov-Ogievskiy
2017-02-18 10:54                         ` Denis V. Lunev
2017-02-20 11:15                           ` Kevin Wolf
2017-02-20 11:21                             ` Denis V. Lunev
2017-02-20 12:06                               ` Vladimir Sementsov-Ogievskiy
2017-02-20 12:23                               ` Kevin Wolf [this message]
2017-02-20 10:09                       ` Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 09/25] qcow2: add .bdrv_load_autoloading_dirty_bitmaps Vladimir Sementsov-Ogievskiy
2017-02-16 11:45   ` Kevin Wolf
2017-02-16 12:47     ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2017-02-16 20:40       ` John Snow
2017-02-17 12:07       ` Vladimir Sementsov-Ogievskiy
2017-02-17 12:21         ` Kevin Wolf
2017-02-17 12:55           ` Vladimir Sementsov-Ogievskiy
2017-02-17 13:04             ` Kevin Wolf
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 10/25] block/dirty-bitmap: add autoload field to BdrvDirtyBitmap Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 11/25] block: introduce persistent dirty bitmaps Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 12/25] block/dirty-bitmap: add bdrv_dirty_bitmap_next() Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 13/25] qcow2: add .bdrv_store_persistent_dirty_bitmaps() Vladimir Sementsov-Ogievskiy
2017-02-16 14:08   ` Kevin Wolf
2017-02-17 12:24     ` Vladimir Sementsov-Ogievskiy
2017-02-17 13:00       ` Kevin Wolf
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 14/25] block: add bdrv_can_store_new_dirty_bitmap Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 15/25] qcow2: add .bdrv_can_store_new_dirty_bitmap Vladimir Sementsov-Ogievskiy
2017-02-15 23:19   ` John Snow
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 16/25] qmp: add persistent flag to block-dirty-bitmap-add Vladimir Sementsov-Ogievskiy
2017-02-15 23:20   ` John Snow
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 17/25] qmp: add autoload parameter " Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 18/25] qmp: add x-debug-block-dirty-bitmap-sha256 Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 19/25] iotests: test qcow2 persistent dirty bitmap Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 20/25] qcow2-refcount: rename inc_refcounts() and make it public Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 21/25] qcow2-bitmap: refcounts Vladimir Sementsov-Ogievskiy
2017-02-16 14:27   ` Kevin Wolf
2017-02-25 16:10     ` Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 22/25] block/dirty-bitmap: add bdrv_remove_persistent_dirty_bitmap Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 23/25] qcow2: add .bdrv_remove_persistent_dirty_bitmap Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 24/25] qmp: block-dirty-bitmap-remove: remove persistent Vladimir Sementsov-Ogievskiy
2017-02-15 10:10 ` [Qemu-devel] [PATCH v15 25/25] qcow2-bitmap: improve check_constraints_on_bitmap Vladimir Sementsov-Ogievskiy
2017-02-15 23:40   ` John Snow
2017-02-16 14:21   ` Kevin Wolf
2017-02-17 10:18     ` Vladimir Sementsov-Ogievskiy
2017-02-17 15:48       ` Eric Blake
2017-02-20 10:20         ` Vladimir Sementsov-Ogievskiy

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=20170220122329.GC4814@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=armbru@redhat.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@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 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).