From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: quintela@redhat.com, qemu-block@nongnu.org,
qemu-devel@nongnu.org, pbonzini@redhat.com, armbru@redhat.com,
eblake@redhat.com, famz@redhat.com, stefanha@redhat.com,
amit.shah@redhat.com, mreitz@redhat.com, kwolf@redhat.com,
peter.maydell@linaro.org, den@openvz.org, jsnow@redhat.com,
lirans@il.ibm.com
Subject: Re: [Qemu-devel] [PATCH 03/17] migration: split common postcopy out of ram postcopy
Date: Mon, 6 Feb 2017 11:30:53 +0000 [thread overview]
Message-ID: <20170206113052.GB2524@work-vm> (raw)
In-Reply-To: <011f92ba-e992-f44f-fdf1-257635d667a3@virtuozzo.com>
* Vladimir Sementsov-Ogievskiy (vsementsov@virtuozzo.com) wrote:
> 01.02.2017 14:06, Vladimir Sementsov-Ogievskiy wrote:
> > 24.01.2017 22:53, Dr. David Alan Gilbert wrote:
> > > * Vladimir Sementsov-Ogievskiy (vsementsov@virtuozzo.com) wrote:
> > > > 24.01.2017 12:24, Juan Quintela wrote:
> > > > > Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> wrote:
> > > > > > Split common postcopy staff from ram postcopy staff.
> > > > > >
> > > > > > Signed-off-by: Vladimir Sementsov-Ogievskiy
> > > > > > <vsementsov@virtuozzo.com>
> > > > > > ---
> > > > > > include/migration/migration.h | 1 +
> > > > > > migration/migration.c | 39
> > > > > > +++++++++++++++++++++++++++------------
> > > > > > migration/postcopy-ram.c | 4 +++-
> > > > > > migration/savevm.c | 31 ++++++++++++++++++++++---------
> > > > > > 4 files changed, 53 insertions(+), 22 deletions(-)
> > > > > >
> > > > > Hi
> > > > >
> > > > > {
> > > > > > MigrationState *s;
> > > > > > @@ -1587,9 +1592,11 @@ static int
> > > > > > postcopy_start(MigrationState *ms, bool *old_vm_running)
> > > > > > * need to tell the destination to throw any
> > > > > > pages it's already received
> > > > > > * that are dirty
> > > > > > */
> > > > > > - if (ram_postcopy_send_discard_bitmap(ms)) {
> > > > > > - error_report("postcopy send discard bitmap failed");
> > > > > > - goto fail;
> > > > > > + if (migrate_postcopy_ram()) {
> > > > > > + if (ram_postcopy_send_discard_bitmap(ms)) {
> > > > > > + error_report("postcopy send discard bitmap failed");
> > > > > > + goto fail;
> > > > > > + }
> > > > > I will have preffered that for the ram commands, to embed the
> > > > > migrate_postocpy_ram() check inside them, but that is taste, and
> > > > > everyone has its own O:-)
> > > > >
> > > > > > diff --git a/migration/savevm.c b/migration/savevm.c
> > > > > > index e436cb2..c8a71c8 100644
> > > > > > --- a/migration/savevm.c
> > > > > > +++ b/migration/savevm.c
> > > > > > @@ -73,7 +73,7 @@ static struct mig_cmd_args {
> > > > > > [MIG_CMD_INVALID] = { .len = -1, .name = "INVALID" },
> > > > > > [MIG_CMD_OPEN_RETURN_PATH] = { .len = 0, .name =
> > > > > > "OPEN_RETURN_PATH" },
> > > > > > [MIG_CMD_PING] = { .len =
> > > > > > sizeof(uint32_t), .name = "PING" },
> > > > > > - [MIG_CMD_POSTCOPY_ADVISE] = { .len = 16, .name =
> > > > > > "POSTCOPY_ADVISE" },
> > > > > > + [MIG_CMD_POSTCOPY_ADVISE] = { .len = -1, .name =
> > > > > > "POSTCOPY_ADVISE" },
> > > > > > [MIG_CMD_POSTCOPY_LISTEN] = { .len = 0, .name =
> > > > > > "POSTCOPY_LISTEN" },
> > > > > > [MIG_CMD_POSTCOPY_RUN] = { .len = 0, .name =
> > > > > > "POSTCOPY_RUN" },
> > > > > > [MIG_CMD_POSTCOPY_RAM_DISCARD] = {
> > > > > > @@ -827,12 +827,17 @@ int
> > > > > > qemu_savevm_send_packaged(QEMUFile *f, const uint8_t
> > > > > > *buf, size_t len)
> > > > > > /* Send prior to any postcopy transfer */
> > > > > > void qemu_savevm_send_postcopy_advise(QEMUFile *f)
> > > > > > {
> > > > > > - uint64_t tmp[2];
> > > > > > - tmp[0] = cpu_to_be64(getpagesize());
> > > > > > - tmp[1] = cpu_to_be64(1ul << qemu_target_page_bits());
> > > > > > + if (migrate_postcopy_ram()) {
> > > > > > + uint64_t tmp[2];
> > > > > > + tmp[0] = cpu_to_be64(getpagesize());
> > > > > > + tmp[1] = cpu_to_be64(1ul << qemu_target_page_bits());
> > > > > > - trace_qemu_savevm_send_postcopy_advise();
> > > > > > - qemu_savevm_command_send(f,
> > > > > > MIG_CMD_POSTCOPY_ADVISE, 16, (uint8_t *)tmp);
> > > > > > + trace_qemu_savevm_send_postcopy_advise();
> > > > > > + qemu_savevm_command_send(f, MIG_CMD_POSTCOPY_ADVISE,
> > > > > > + 16, (uint8_t *)tmp);
> > > > > > + } else {
> > > > > > + qemu_savevm_command_send(f,
> > > > > > MIG_CMD_POSTCOPY_ADVISE, 0, NULL);
> > > > > > + }
> > > > > > }
> > > > > > /* Sent prior to starting the destination running in
> > > > > > postcopy, discard pages
> > > > > I haven't yet figured out why you are reusing this command with a
> > > > > different number of parameters.
> > > > > For this to pass, I need that Dave comment on this.
> > > > >
> > > > > So,
> > > > >
> > > > > Reviewed-by: Juan Quintela <quintela@redhat.com>
> > > > >
> > > > > conditioned that Dave agrees with this.
> > > > These parameters are unrelated if ram postcopy is disabled. So,
> > > > I should be
> > > > better to have a possibility of skipping them, then to send
> > > > unneeded numbers
> > > > and write separate code to read them from the stream (rewriting
> > > > loadvm_postcopy_handle_advise to just read these two numbers and
> > > > do nothing
> > > > about ram postcopy for this case).
> > > I think I'd prefer either a new command or keeping these fields
> > > (probably all 0 ?)
> > > my worry is what happens in the case if we add a 3rd postcopy
> > > subfeature;
> > > In your case we have three possibilities:
> > >
> > > a) Postcopy RAM only - 16 bytes
> > > b) Postcopy persistent-dirty-bitmap only - 0 bytes
> > > c) Both - 16 bytes
> > >
> > > Lets say we added postcopy-foo in the future and it wanted to add
> > > another 16 bytes, what would it send if it was
> > > foo+persistent-dirty-bitmap and no RAM?
> > > We'd end up with 16 bytes sent but you'd have to be very careful
> > > never to get that confused with case (a) above.
> > >
> > > (I don't feel too strongly about it though)
> >
> > We would like to stick current solution if it is not a problem. About
> > postcopy-foo: on the one hand, the format may be determined from
> > migration capabilities, on the other hand we can add for example 4bytes
> > format identifier starting from postcopy-foo and make all parameters
> > size to be at least 20 bytes. Or something like this.
> >
>
> Ok?
Yes OK; just please make sure it's all very commented and obvious.
Dave
> >
> >
> > >
> > > Dave
> > >
> > > > --
> > > > Best regards,
> > > > Vladimir
> > > >
> > > --
> > > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
> >
> >
>
>
> --
> Best regards,
> Vladimir
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2017-02-06 11:31 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-22 17:54 [Qemu-devel] [PATCH v4 00/17] Dirty bitmaps postcopy migration Vladimir Sementsov-Ogievskiy
2016-11-22 17:54 ` [Qemu-devel] [PATCH 01/17] migration: add has_postcopy savevm handler Vladimir Sementsov-Ogievskiy
2016-11-22 17:54 ` [Qemu-devel] [PATCH 02/17] migration: fix ram_save_pending Vladimir Sementsov-Ogievskiy
2016-11-22 17:54 ` [Qemu-devel] [PATCH 03/17] migration: split common postcopy out of ram postcopy Vladimir Sementsov-Ogievskiy
2017-01-24 9:24 ` Juan Quintela
2017-01-24 9:35 ` Vladimir Sementsov-Ogievskiy
2017-01-24 19:53 ` Dr. David Alan Gilbert
2017-01-31 14:04 ` Vladimir Sementsov-Ogievskiy
2017-01-31 15:15 ` Dr. David Alan Gilbert
2017-02-01 11:06 ` Vladimir Sementsov-Ogievskiy
2017-02-03 11:13 ` Vladimir Sementsov-Ogievskiy
2017-02-06 11:30 ` Dr. David Alan Gilbert [this message]
2016-11-22 17:54 ` [Qemu-devel] [PATCH 04/17] migration: introduce postcopy-only pending Vladimir Sementsov-Ogievskiy
2017-01-24 9:17 ` Juan Quintela
2016-11-22 17:54 ` [Qemu-devel] [PATCH 05/17] block: add bdrv_next_dirty_bitmap() Vladimir Sementsov-Ogievskiy
2016-11-22 17:54 ` [Qemu-devel] [PATCH 06/17] block: add bdrv_dirty_bitmap_enable_successor() Vladimir Sementsov-Ogievskiy
2017-02-01 22:29 ` Max Reitz
2016-11-22 17:54 ` [Qemu-devel] [PATCH 07/17] qapi: add dirty-bitmaps migration capability Vladimir Sementsov-Ogievskiy
2017-01-24 9:18 ` Juan Quintela
2016-11-22 17:54 ` [Qemu-devel] [PATCH 08/17] block/dirty-bitmap: add bdrv_dirty_bitmap_release_successor Vladimir Sementsov-Ogievskiy
2017-02-01 22:29 ` Max Reitz
2016-11-22 17:54 ` [Qemu-devel] [PATCH 09/17] migration: include migrate_dirty_bitmaps in migrate_postcopy Vladimir Sementsov-Ogievskiy
2017-01-24 9:29 ` Juan Quintela
2016-11-22 17:54 ` [Qemu-devel] [PATCH 10/17] migration/qemu-file: add qemu_put_counted_string() Vladimir Sementsov-Ogievskiy
2017-01-24 9:29 ` Juan Quintela
2016-11-22 17:54 ` [Qemu-devel] [PATCH 11/17] migration: add is_active_iterate handler Vladimir Sementsov-Ogievskiy
2017-01-24 9:48 ` Juan Quintela
2017-02-07 12:44 ` Vladimir Sementsov-Ogievskiy
2016-11-22 17:54 ` [Qemu-devel] [PATCH 12/17] migration: add postcopy migration of dirty bitmaps Vladimir Sementsov-Ogievskiy
2017-01-24 9:40 ` Juan Quintela
2017-02-01 23:02 ` Max Reitz
2016-11-22 17:54 ` [Qemu-devel] [PATCH 13/17] iotests: add add_incoming_migration to VM class Vladimir Sementsov-Ogievskiy
2016-11-22 17:54 ` [Qemu-devel] [PATCH 14/17] qmp: add x-debug-block-dirty-bitmap-sha256 Vladimir Sementsov-Ogievskiy
2016-11-22 17:54 ` [Qemu-devel] [PATCH 15/17] iotests: add default node-name Vladimir Sementsov-Ogievskiy
2017-01-09 15:57 ` Denis V. Lunev
2017-01-09 16:04 ` Vladimir Sementsov-Ogievskiy
2016-11-22 17:54 ` [Qemu-devel] [PATCH 16/17] iotests: add dirty bitmap migration test Vladimir Sementsov-Ogievskiy
2017-02-01 23:12 ` Max Reitz
2017-02-03 10:10 ` Vladimir Sementsov-Ogievskiy
2017-02-03 11:08 ` Vladimir Sementsov-Ogievskiy
2017-02-03 19:07 ` Max Reitz
2017-02-03 19:06 ` Max Reitz
2016-11-22 17:54 ` [Qemu-devel] [PATCH 17/17] iotests: add dirty bitmap postcopy test Vladimir Sementsov-Ogievskiy
2017-02-01 23:21 ` Max Reitz
2016-12-21 14:58 ` [Qemu-devel] ping Re: [PATCH v4 00/17] Dirty bitmaps postcopy migration Vladimir Sementsov-Ogievskiy
2017-01-23 11:48 ` [Qemu-devel] ping2 " Vladimir Sementsov-Ogievskiy
2017-01-23 17:27 ` John Snow
2017-01-24 9:49 ` Juan Quintela
-- strict thread matches above, loose matches on Subject: below --
2017-02-13 9:54 [Qemu-devel] [PATCH v6 " Vladimir Sementsov-Ogievskiy
2017-02-13 9:54 ` [Qemu-devel] [PATCH 03/17] migration: split common postcopy out of ram postcopy Vladimir Sementsov-Ogievskiy
2017-02-07 15:05 [Qemu-devel] [PATCH v5 00/17] Dirty bitmaps postcopy migration Vladimir Sementsov-Ogievskiy
2017-02-07 15:05 ` [Qemu-devel] [PATCH 03/17] migration: split common postcopy out of ram postcopy Vladimir Sementsov-Ogievskiy
2016-11-21 15:29 [Qemu-devel] [PATCH v3 00/17] Dirty bitmaps postcopy migration Vladimir Sementsov-Ogievskiy
2016-11-21 15:29 ` [Qemu-devel] [PATCH 03/17] migration: split common postcopy out of ram postcopy Vladimir Sementsov-Ogievskiy
2016-02-12 18:00 [Qemu-devel] [PATCH RFC 00/17] Dirty bitmaps postcopy migration Vladimir Sementsov-Ogievskiy
2016-02-12 18:00 ` [Qemu-devel] [PATCH 03/17] migration: split common postcopy out of ram postcopy 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=20170206113052.GB2524@work-vm \
--to=dgilbert@redhat.com \
--cc=amit.shah@redhat.com \
--cc=armbru@redhat.com \
--cc=den@openvz.org \
--cc=eblake@redhat.com \
--cc=famz@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=lirans@il.ibm.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--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).