All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] migrations: Fix potential rare race of migration-test after yank
@ 2021-07-21  1:21 Peter Xu
  2021-07-21  1:21 ` [PATCH 1/5] migration: Fix missing join() of rp_thread Peter Xu
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Peter Xu @ 2021-07-21  1:21 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Lukas Straub, Juan Quintela,
	Dr . David Alan Gilbert, peterx, Leonardo Bras Soares Passos

Patch 1 fixes a possible race that migration thread can accidentally skip
join() of rp_thread even if the return thread is enabled.  Patch 1 is suspected
to also be the root cause of the recent hard-to-reproduce migration-test
failure here reported by PMM:

https://lore.kernel.org/qemu-devel/YPamXAHwan%2FPPXLf@work-vm/

I didn't reproduce it myself; but after co-debugged with Dave it's suspected
that the race of rp_thread could be the cause.  It's not exposed before because
yank is soo strict on releasing instances, while we're not that strict before,
and didn't join() on rp_thread wasn't so dangerous after all when migration
succeeded before.

Patch 2 fixes another theoretical race on accessing from_dst_file spotted by
Dave.  I don't think there's known issues with it, but may still worth fixing.

Patch 3 should be a cleanup on yank that I think would be nice to have.

Patch 4-5 are further cleanups to remove the ref==1 check in channel_close(),
finally, as I always thought that's a bit hackish.  So I used explicit
unregister of the yank function at necessary places to replace that ref==1 one.

I still think having patch 3-5 altogether would be great, however I think patch
1 should still be the most important to be reviewed.  Also it would be great to
know whether patch 1 could fix the known yank crash.

Please review, thanks.

Peter Xu (5):
  migration: Fix missing join() of rp_thread
  migration: Shutdown src in await_return_path_close_on_source()
  migration: Introduce migration_ioc_[un]register_yank()
  migration: Teach QEMUFile to be QIOChannel-aware
  migration: Move the yank unregister of channel_close out

 migration/channel.c           | 15 ++-----------
 migration/migration.c         | 18 +++++++++++----
 migration/migration.h         |  7 ++++++
 migration/multifd.c           |  8 ++-----
 migration/qemu-file-channel.c | 11 ++-------
 migration/qemu-file.c         | 17 +++++++++++++-
 migration/qemu-file.h         |  4 +++-
 migration/ram.c               |  2 +-
 migration/savevm.c            | 11 +++++++--
 migration/yank_functions.c    | 42 +++++++++++++++++++++++++++++++++++
 migration/yank_functions.h    |  3 +++
 11 files changed, 101 insertions(+), 37 deletions(-)

-- 
2.31.1




^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-07-21 18:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21  1:21 [PATCH 0/5] migrations: Fix potential rare race of migration-test after yank Peter Xu
2021-07-21  1:21 ` [PATCH 1/5] migration: Fix missing join() of rp_thread Peter Xu
2021-07-21  9:49   ` Dr. David Alan Gilbert
2021-07-21  1:21 ` [PATCH 2/5] migration: Shutdown src in await_return_path_close_on_source() Peter Xu
2021-07-21  9:55   ` Dr. David Alan Gilbert
2021-07-21 15:40     ` Peter Xu
2021-07-21 18:00       ` Dr. David Alan Gilbert
2021-07-21 18:12         ` Peter Xu
2021-07-21 15:57     ` Daniel P. Berrangé
2021-07-21  1:21 ` [PATCH 3/5] migration: Introduce migration_ioc_[un]register_yank() Peter Xu
2021-07-21  9:58   ` Dr. David Alan Gilbert
2021-07-21  1:21 ` [PATCH 4/5] migration: Teach QEMUFile to be QIOChannel-aware Peter Xu
2021-07-21 10:27   ` Dr. David Alan Gilbert
2021-07-21 10:57     ` Daniel P. Berrangé
2021-07-21  1:21 ` [PATCH 5/5] migration: Move the yank unregister of channel_close out Peter Xu
2021-07-21 10:39   ` Dr. David Alan Gilbert
2021-07-21 15:45     ` Peter Xu

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.