RFC migration: Fix multifd qemu_mutex_destroy race
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 RFC Latest4 patches 3 repliesIn review
- v1 RFC2 patches 14 repliesSuperseded
changes from the cover letter
- dropped the Error patch
- removed p->running
- joined the TLS thread
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | migration/multifd: Stop setting p->ioc before connectingmigration/ | +1 | 2 replies | |
| 2/4 | migration/multifd: Join the TLS threadmigration/ migration/ | +10 | 1 reply | |
| 3/4 | migration/multifd: Remove p->runningmigration/ migration/ | +22 | 0 replies | |
| 4/4 | migration/multifd: Move semaphore release into main threadmigration/ migration/ | +20 | 0 replies |
Reviews trailers per patch
1 of 4 patches has a Reviewed-by or Acked-by.
| Patch | Peter Xu | Juan Quintela |
|---|---|---|
| 1/4 | R-b | R-b |
| 2/4 | ||
| 3/4 | ||
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [RFC PATCH v2 0/4] migration: Fix multifd qemu_mutex_destroy race
changes:
- dropped the Error patch
- removed p->running
- joined the TLS thread
v1:
https://lore.kernel.org/r/[email protected]
We're calling qemu_sem_post() in threads other than the multifd channel and the migration thread. This is vulnerable to a race with multifd_save_cleanup() which calls qemu_sem_destroy(). If we attempt to destroy the semaphore mutex with the lock taken, the code asserts.
We're hitting this in the current master and we've had reports of this in the past already:
[PATCH] migrate/multifd: fix coredump when the multifd thread cleanup
https://lore.kernel.org/r/[email protected]
Fabiano Rosas (4):
migration/multifd: Stop setting p->ioc before connecting migration/multifd: Join the TLS thread migration/multifd: Remove p->running migration/multifd: Move semaphore release into main thread
migration/migration.c | 4 +- migration/multifd.c | 87 +++++++++++++++++++++++-------------------- migration/multifd.h | 9 ++--- 3 files changed, 53 insertions(+), 47 deletions(-)
Signature · 1 line
2.35.3