From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Cc: Laurent Vivier <lvivier@redhat.com>,
Thomas Huth <thuth@redhat.com>,
kvm@vger.kernel.org, Juan Quintela <quintela@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Ivan Ren <renyime@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>,
Ivan Ren <ivanren@tencent.com>,
Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH 4/4] migration: fix migrate_cancel multifd migration leads destination hung forever
Date: Wed, 24 Jul 2019 11:55:23 +0200 [thread overview]
Message-ID: <20190724095523.1527-5-quintela@redhat.com> (raw)
In-Reply-To: <20190724095523.1527-1-quintela@redhat.com>
From: Ivan Ren <renyime@gmail.com>
When migrate_cancel a multifd migration, if run sequence like this:
[source] [destination]
multifd_send_sync_main[finish]
multifd_recv_thread wait &p->sem_sync
shutdown to_dst_file
detect error from_src_file
send RAM_SAVE_FLAG_EOS[fail] [no chance to run multifd_recv_sync_main]
multifd_load_cleanup
join multifd receive thread forever
will lead destination qemu hung at following stack:
pthread_join
qemu_thread_join
multifd_load_cleanup
process_incoming_migration_co
coroutine_trampoline
Signed-off-by: Ivan Ren <ivanren@tencent.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <1561468699-9819-4-git-send-email-ivanren@tencent.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/ram.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/migration/ram.c b/migration/ram.c
index eb6716710e..889148dd84 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1292,6 +1292,11 @@ int multifd_load_cleanup(Error **errp)
if (p->running) {
p->quit = true;
+ /*
+ * multifd_recv_thread may hung at MULTIFD_FLAG_SYNC handle code,
+ * however try to wakeup it without harm in cleanup phase.
+ */
+ qemu_sem_post(&p->sem_sync);
qemu_thread_join(&p->thread);
}
object_unref(OBJECT(p->c));
--
2.21.0
next prev parent reply other threads:[~2019-07-24 9:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-24 9:55 [Qemu-devel] [PATCH 0/4] migration: fix migrate_cancel problems of multifd Juan Quintela
2019-07-24 9:55 ` [Qemu-devel] [PATCH 1/4] migration: fix migrate_cancel leads live_migration thread endless loop Juan Quintela
2019-07-24 10:57 ` Dr. David Alan Gilbert
2019-07-24 9:55 ` [Qemu-devel] [PATCH 2/4] migration: fix migrate_cancel leads live_migration thread hung forever Juan Quintela
2019-07-24 10:58 ` Dr. David Alan Gilbert
2019-07-24 9:55 ` [Qemu-devel] [PATCH 3/4] migration: Make explicit that we are quitting multifd Juan Quintela
2019-07-24 11:01 ` Dr. David Alan Gilbert
2019-07-24 9:55 ` Juan Quintela [this message]
2019-07-24 11:03 ` [Qemu-devel] [PATCH 4/4] migration: fix migrate_cancel multifd migration leads destination hung forever Dr. David Alan Gilbert
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=20190724095523.1527-5-quintela@redhat.com \
--to=quintela@redhat.com \
--cc=dgilbert@redhat.com \
--cc=ivanren@tencent.com \
--cc=kvm@vger.kernel.org \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=renyime@gmail.com \
--cc=rth@twiddle.net \
--cc=thuth@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).