qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 1/2] migration: fix RCU deadlock
Date: Thu,  9 Jul 2015 16:57:09 +0200	[thread overview]
Message-ID: <1436453830-4700-2-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1436453830-4700-1-git-send-email-pbonzini@redhat.com>

migration_end calls synchronize_rcu() within a critical section.
That causes a deadlock; move the call after rcu_read_unlock().

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 migration/ram.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/migration/ram.c b/migration/ram.c
index c696814..1e58cd3 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1266,9 +1266,10 @@ static int ram_save_complete(QEMUFile *f, void *opaque)
 
     flush_compressed_data(f);
     ram_control_after_iterate(f, RAM_CONTROL_FINISH);
-    migration_end();
 
     rcu_read_unlock();
+
+    migration_end();
     qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
 
     return 0;
-- 
2.4.3

  reply	other threads:[~2015-07-09 14:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09 14:57 [Qemu-devel] [PULL for-2.4-rc0 0/2] Urgent fixes for 2.4 Paolo Bonzini
2015-07-09 14:57 ` Paolo Bonzini [this message]
2015-07-09 14:57 ` [Qemu-devel] [PULL 2/2] crypto: fix builtin qcrypto_cipher_free Paolo Bonzini
2015-07-09 15:04   ` Aurelien Jarno
2015-07-09 15:19 ` [Qemu-devel] [PULL for-2.4-rc0 0/2] Urgent fixes for 2.4 Christian Borntraeger
2015-07-09 15:21   ` Peter Maydell
2015-07-09 16:28 ` Peter Maydell

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=1436453830-4700-2-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).