From: Peter Xu <peterx@redhat.com>
To: David Hildenbrand <david@redhat.com>
Cc: qemu-devel@nongnu.org,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
Juan Quintela <quintela@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
Michal Privoznik <mprivozn@redhat.com>
Subject: Re: [PATCH v3 1/6] migration: Allow immutable device state to be migrated early (i.e., before RAM)
Date: Thu, 5 Jan 2023 12:15:18 -0500 [thread overview]
Message-ID: <Y7cFplyGc4hIrYZW@x1n> (raw)
In-Reply-To: <d60f9272-1e81-00da-8046-2264a9b97e58@redhat.com>
On Thu, Jan 05, 2023 at 09:35:54AM +0100, David Hildenbrand wrote:
> On 04.01.23 18:23, Peter Xu wrote:
> > On Thu, Dec 22, 2022 at 12:02:10PM +0100, David Hildenbrand wrote:
> > > Migrating device state before we start iterating is currently impossible.
> > > Introduce and use qemu_savevm_state_start_precopy(), and use
> > > a new special migration priority -- MIG_PRI_POST_SETUP -- to decide whether
> > > state will be saved in qemu_savevm_state_start_precopy() or in
> > > qemu_savevm_state_complete_precopy_*().
> >
> > Can something like this be done in qemu_savevm_state_setup()?
>
> Hi Peter,
Hi, David,
>
> Do you mean
>
> (a) Moving qemu_savevm_state_start_precopy() effectively into
> qemu_savevm_state_setup()
>
> (b) Using se->ops->save_setup()
I meant (b).
>
> I first tried going via (b), but decided to go the current way of using a
> proper vmstate with properties (instead of e.g., filling the stream
> manually), which also made vmdesc handling possible (and significantly
> cleaner).
>
> Regarding (a), I decided to not move logic of
> qemu_savevm_state_start_precopy() into qemu_savevm_state_setup(), because it
> looked cleaner to save device state with the BQL held and for background
> snapshots, the VM has been stopped. To decouple device state saving from the
> setup path, just like we do it right now for all vmstates.
Is BQL required or optional? IIUC it's at least still not taken in the
migration thread path, only in savevm path.
>
> Having that said, for virtio-mem, it would still work because that state is
> immutable once migration starts, but it felt cleaner to separate the setup()
> phase from actual device state saving.
I get the point. My major concerns are:
(1) The new migration priority is changing the semantic of original,
making it over-complicated
(2) The new precopy-start routine added one more step to the migration
framework, while it's somehow overlapping (if not to say, mostly the
same as..) save_setup().
For (1): the old priority was only deciding the order of save entries in
the global list, nothing more than that. Even if we want to have a
precopy-start phase, I'd suggest we use something else and keep the
migration priority simple. Otherwise we really need serious documentation
for MigrationPriority and if so I'd rather don't bother and not reuse the
priority field.
For (2), if you see there're a bunch of save_setup() that already does
things like transferring static data besides the device states. Besides
the notorious ram_save_setup() there's also dirty_bitmap_save_setup() which
also sends a bitmap during save_setup() and some others. It looks clean to
me to do it in the same way as we used to.
Reusing vmstate_save() and vmsd structures are useful too which I totally
agree. So.. can we just call vmstate_save_state() in the save_setup() of
the other new vmsd of virtio-mem?
Thanks,
--
Peter Xu
next prev parent reply other threads:[~2023-01-05 17:30 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-22 11:02 [PATCH v3 0/6] virtio-mem: Handle preallocation with migration David Hildenbrand
2022-12-22 11:02 ` [PATCH v3 1/6] migration: Allow immutable device state to be migrated early (i.e., before RAM) David Hildenbrand
2022-12-23 9:34 ` David Hildenbrand
2023-01-05 1:27 ` Michael S. Tsirkin
2023-01-05 8:20 ` David Hildenbrand
2023-01-04 17:23 ` Peter Xu
2023-01-05 8:35 ` David Hildenbrand
2023-01-05 17:15 ` Peter Xu [this message]
2023-01-09 14:34 ` David Hildenbrand
2023-01-09 19:54 ` Peter Xu
2023-01-10 10:18 ` David Hildenbrand
2023-01-10 11:52 ` David Hildenbrand
2023-01-10 20:03 ` Peter Xu
2023-01-11 13:48 ` David Hildenbrand
2023-01-11 16:35 ` Peter Xu
2023-01-11 16:58 ` David Hildenbrand
2023-01-11 17:28 ` Peter Xu
2023-01-11 17:44 ` David Hildenbrand
2022-12-22 11:02 ` [PATCH v3 2/6] migration/vmstate: Introduce VMSTATE_WITH_TMP_TEST() and VMSTATE_BITMAP_TEST() David Hildenbrand
2023-01-05 17:33 ` Dr. David Alan Gilbert
2022-12-22 11:02 ` [PATCH v3 3/6] migration: Factor out checks for advised and listening incomming postcopy David Hildenbrand
2023-01-05 17:18 ` Peter Xu
2023-01-09 14:39 ` David Hildenbrand
2023-01-09 14:42 ` David Hildenbrand
2022-12-22 11:02 ` [PATCH v3 4/6] virtio-mem: Fail if a memory backend with "prealloc=on" is specified David Hildenbrand
2022-12-22 11:02 ` [PATCH v3 5/6] virtio-mem: Migrate bitmap, size and sanity checks early David Hildenbrand
2022-12-22 11:02 ` [PATCH v3 6/6] virtio-mem: Proper support for preallocation with migration David Hildenbrand
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=Y7cFplyGc4hIrYZW@x1n \
--to=peterx@redhat.com \
--cc=david@redhat.com \
--cc=dgilbert@redhat.com \
--cc=mprivozn@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.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).