From: Peter Xu <peterx@redhat.com>
To: Avihai Horon <avihaih@nvidia.com>
Cc: qemu-devel@nongnu.org, "Alex Williamson" <alex@shazbot.org>,
"Cédric Le Goater" <clg@redhat.com>,
"Fabiano Rosas" <farosas@suse.de>,
"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Zhao Liu" <zhao1.liu@intel.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Cornelia Huck" <cohuck@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Maor Gottlieb" <maorg@nvidia.com>
Subject: Re: [PATCH 07/14] migration: Make switchover-ack re-usable
Date: Tue, 26 May 2026 12:23:43 -0400 [thread overview]
Message-ID: <ahXJD6QkXccf60Cn@x1.local> (raw)
In-Reply-To: <f2c43343-d286-47a7-9596-8de2d5a6e5c5@nvidia.com>
On Tue, May 26, 2026 at 12:08:34PM +0300, Avihai Horon wrote:
>
> On 5/25/2026 6:01 PM, Peter Xu wrote:
> > External email: Use caution opening links or attachments
> >
> >
> > On Sun, May 24, 2026 at 09:34:48AM +0300, Avihai Horon wrote:
> > > Yes I think so.
> > >
> > > We just need to indicate modules that it’s the last query during switchover
> > > so they can handle it properly.
> > > Do you think it would be reasonable to add a "bool final" param to
> > > save_query_pending handler?
> > >
> > > For RAM it will be used to indicate we are running under the BQL (since
> > > currently save_query_pending runs only outside BQL) and to pass the proper
> > > last_stage param into migration_bitmap_sync_precopy().
> > > For VFIO it will indicate we should not do a query precopy info ioctl (which
> > > is only valid in VFIO precopy states, not while VM is stopped).
> > Yes, a final boolean sounds reasonable, implying both (1) last sync before
> > switchover, VM stopped, (2) BQL held.
> >
> > For VFIO, I double checked the complete() that does not depend on the
> > precopy_bytes fetched, then it should be fine indeed,
> >
> > vfio_save_complete_precopy():
> > do {
> > data_size = vfio_save_block(f, vbasedev->migration);
> > if (data_size < 0) {
> > return data_size;
> > }
> > } while (data_size);
> >
> > It's just werid to see that it doesn't depend on either precopy_bytes or
> > initial_bytes, even if logically it should.. this will be confusing to
> > whoever start reading this code.. but I understand not much we can do with
> > the current kernel API.
> >
> > Side note: should we still better update these fields to make sure they'll
> > be zero after migration? That means vfio_update_estimated_pending_data() in
> > vfio_save_complete_precopy() too, with/without further sanity checks. That
> > seems to be missing right now. I'm not sure if it's intentional.
>
> Yes, it's intentional, since we don't use these values after calling
> vfio_save_complete_precopy() -- they are only used for downtime estimation
> prior switchover.
> Precopy_init/dirty sizes are zeroed in vfio_save_cleanup() though, but not
> stopcopy_size (however, that's benign, since upon new migration it will be
> reset before used).
>
> So calling vfio_update_estimated_pending_data() here seems redundant to me.
Logically migration can still fail during complete():
qemu_savevm_state_complete_precopy():
ret = qemu_savevm_state_complete_precopy_iterable(f, false);
if (ret) {
return ret;
}
If vfio_update_estimated_pending_data() has the safe guard for any form of
overflow, then IMHO we should try to maintain those counters if possible.
Thanks,
--
Peter Xu
next prev parent reply other threads:[~2026-05-26 16:24 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-05 8:14 [PATCH 00/14] Make switchover-ack re-usable and add VFIO precopy REINIT feature Avihai Horon
2026-05-05 8:14 ` [PATCH 01/14] scripts/update-linux-headers: Add typelimits.h Avihai Horon
2026-05-07 7:54 ` Cédric Le Goater
2026-05-07 9:07 ` gaosong
2026-05-05 8:14 ` [PATCH 02/14] linux-headers: Update to Linux v7.1-rc1 Avihai Horon
2026-05-07 9:16 ` Cédric Le Goater
2026-05-05 8:14 ` [PATCH 03/14] migration: Propagate errors in migration_completion_precopy() Avihai Horon
2026-05-07 8:03 ` Cédric Le Goater
2026-05-08 13:01 ` Avihai Horon
2026-05-15 15:20 ` Peter Xu
2026-05-18 12:02 ` Avihai Horon
2026-05-05 8:14 ` [PATCH 04/14] migration: Log the approver in qemu_loadvm_approve_switchover() Avihai Horon
2026-05-07 8:09 ` Cédric Le Goater
2026-05-08 13:07 ` Avihai Horon
2026-05-15 15:24 ` Peter Xu
2026-05-05 8:14 ` [PATCH 05/14] migration: Replace switchover_ack_needed SaveVMHandler Avihai Horon
2026-05-15 15:27 ` Peter Xu
2026-05-05 8:14 ` [PATCH 06/14] migration: Rename switchover-ack code to legacy Avihai Horon
2026-05-05 8:14 ` [PATCH 07/14] migration: Make switchover-ack re-usable Avihai Horon
2026-05-07 14:10 ` Fabiano Rosas
2026-05-19 19:48 ` Peter Xu
2026-05-21 13:39 ` Avihai Horon
2026-05-21 14:54 ` Peter Xu
2026-05-24 6:34 ` Avihai Horon
2026-05-25 15:01 ` Peter Xu
2026-05-26 9:08 ` Avihai Horon
2026-05-26 16:23 ` Peter Xu [this message]
2026-05-27 8:17 ` Avihai Horon
2026-05-27 15:38 ` Peter Xu
2026-05-28 9:10 ` Avihai Horon
2026-05-28 13:21 ` Peter Xu
2026-05-05 8:14 ` [PATCH 08/14] migration: Check switchover-ack during switchover phase Avihai Horon
2026-05-05 8:14 ` [PATCH 09/14] vfio/migration: Re-query precopy size before sending VFIO_MIG_FLAG_DEV_INIT_DATA_SENT Avihai Horon
2026-05-07 8:24 ` Cédric Le Goater
2026-05-08 13:10 ` Avihai Horon
2026-05-19 19:58 ` Peter Xu
2026-05-21 13:46 ` Avihai Horon
2026-05-21 15:04 ` Peter Xu
2026-05-24 6:45 ` Avihai Horon
2026-05-25 15:19 ` Peter Xu
2026-05-26 9:17 ` Avihai Horon
2026-05-26 17:38 ` Peter Xu
2026-05-05 8:14 ` [PATCH 10/14] vfio/migration: Add Error ** parameter to vfio_migration_init() Avihai Horon
2026-05-07 7:59 ` Cédric Le Goater
2026-05-08 13:18 ` Avihai Horon
2026-05-08 13:21 ` Avihai Horon
2026-05-05 8:14 ` [PATCH 11/14] vfio/migration: Add new switchover-ack mechanism Avihai Horon
2026-05-05 8:14 ` [PATCH 12/14] vfio/migration: Implement VFIO_PRECOPY_INFO_REINIT feature Avihai Horon
2026-05-05 8:14 ` [PATCH 13/14] vfio/migration: Check VFIO_PRECOPY_INFO_REINIT during switchover Avihai Horon
2026-05-05 8:14 ` [PATCH 14/14] migration: Enable new switchover-ack Avihai Horon
2026-05-19 20:11 ` Peter Xu
2026-05-21 14:00 ` Avihai Horon
2026-05-21 15:05 ` Peter Xu
2026-05-19 20:09 ` [PATCH 00/14] Make switchover-ack re-usable and add VFIO precopy REINIT feature Peter Xu
2026-05-21 13:53 ` Avihai Horon
2026-05-21 15:20 ` Peter Xu
2026-05-24 6:58 ` Avihai Horon
2026-05-25 15:15 ` Peter Xu
2026-05-26 9:10 ` Avihai Horon
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=ahXJD6QkXccf60Cn@x1.local \
--to=peterx@redhat.com \
--cc=alex@shazbot.org \
--cc=avihaih@nvidia.com \
--cc=clg@redhat.com \
--cc=cohuck@redhat.com \
--cc=farosas@suse.de \
--cc=maorg@nvidia.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-devel@nongnu.org \
--cc=zhao1.liu@intel.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.