qemu-e2k/migration
Fabiano Rosas 93fa9dc2e0 migration/multifd: Add a synchronization point for channel creation
It is possible that one of the multifd channels fails to be created at
multifd_new_send_channel_async() while the rest of the channel
creation tasks are still in flight.

This could lead to multifd_save_cleanup() executing the
qemu_thread_join() loop too early and not waiting for the threads
which haven't been created yet, leading to the freeing of resources
that the newly created threads will try to access and crash.

Add a synchronization point after which there will be no attempts at
thread creation and therefore calling multifd_save_cleanup() past that
point will ensure it properly waits for the threads.

A note about performance: Prior to this patch, if a channel took too
long to be established, other channels could finish connecting first
and already start taking load. Now we're bounded by the
slowest-connecting channel.

Reported-by: Avihai Horon <avihaih@nvidia.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20240206215118.6171-7-farosas@suse.de
Signed-off-by: Peter Xu <peterx@redhat.com>
2024-02-07 09:53:18 +08:00
..
block-dirty-bitmap.c
block.c
block.h
channel-block.c
channel-block.h
channel.c
channel.h
colo-failover.c
colo.c
dirtyrate.c
dirtyrate.h
exec.c
exec.h
fd.c
fd.h
file.c
file.h
global_state.c
meson.build
migration-hmp-cmds.c
migration-stats.c
migration-stats.h
migration.c migration/multifd: Move multifd_send_setup into migration thread 2024-02-07 09:53:18 +08:00
migration.h migration: Centralize BH creation and dispatch 2024-01-29 11:02:12 +08:00
multifd-zlib.c migration/multifd: Move header prepare/fill into send_prepare() 2024-02-05 14:42:10 +08:00
multifd-zstd.c migration/multifd: Move header prepare/fill into send_prepare() 2024-02-05 14:42:10 +08:00
multifd.c migration/multifd: Add a synchronization point for channel creation 2024-02-07 09:53:18 +08:00
multifd.h migration/multifd: Move multifd_send_setup error handling in to the function 2024-02-07 09:53:18 +08:00
options.c
options.h
page_cache.c
page_cache.h
postcopy-ram.c
postcopy-ram.h
qemu-file.c
qemu-file.h
ram-compress.c
ram-compress.h
ram.c migration/multifd: Change retval of multifd_queue_page() 2024-02-05 14:42:10 +08:00
ram.h
rdma.c
rdma.h
savevm.c migration: Centralize BH creation and dispatch 2024-01-29 11:02:12 +08:00
savevm.h
socket.c
socket.h
target.c
threadinfo.c
threadinfo.h
tls.c
tls.h
trace-events migration/multifd: Split multifd_send_terminate_threads() 2024-02-05 14:42:10 +08:00
trace.h
vmstate-types.c
vmstate.c
xbzrle.c
xbzrle.h
yank_functions.c migration/yank: Use channel features 2024-01-29 11:02:12 +08:00
yank_functions.h