]> git.ipfire.org Git - thirdparty/qemu.git/commit
migration/multifd: Allow to sync with sender threads only
authorPeter Xu <peterx@redhat.com>
Fri, 6 Dec 2024 22:47:50 +0000 (17:47 -0500)
committerFabiano Rosas <farosas@suse.de>
Thu, 9 Jan 2025 20:38:12 +0000 (17:38 -0300)
commit10801e08ac926a5a6083a9bd2ff87b153ccb95b1
tree2593e5e0726ad3e8253758512137bf146cb1a764
parent1d457daf868191dc1c0b58dc7280799964f40334
migration/multifd: Allow to sync with sender threads only

Teach multifd_send_sync_main() to sync with threads only.

We already have such requests, which is when mapped-ram is enabled with
multifd.  In that case, no SYNC messages will be pushed to the stream when
multifd syncs the sender threads because there's no destination threads
waiting for that.  The whole point of the sync is to make sure all threads
finished their jobs.

So fundamentally we have a request to do the sync in different ways:

  - Either to sync the threads only,
  - Or to sync the threads but also with the destination side.

Mapped-ram did it already because of the use_packet check in the sync
handler of the sender thread.  It works.

However it may stop working when e.g. VFIO may start to reuse multifd
channels to push device states.  In that case VFIO has similar request on
"thread-only sync" however we can't check a flag because such sync request
can still come from RAM which needs the on-wire notifications.

Paving way for that by allowing the multifd_send_sync_main() to specify
what kind of sync the caller needs.  We can use it for mapped-ram already.

No functional change intended.

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Message-Id: <20241206224755.1108686-3-peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
migration/multifd-nocomp.c
migration/multifd.c
migration/multifd.h