qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PULL 08/21] rcu: run RCU callbacks under the BQL


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PULL 08/21] rcu: run RCU callbacks under the BQL
Date: Fri, 27 Feb 2015 19:27:03 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0


On 27/02/2015 15:24, Leon Alrae wrote:
> On 27/02/2015 13:17, Paolo Bonzini wrote:
>> Can you test this patch?  (On top of the previous one).
> 
> With this change the system doesn't boot at all I'm afraid.

Hmm, it works for me and fixes the deadlock with Aurelien's images.

Just to be clear, this is the patch I'm testing on top of
origin/master:

diff --git a/cpus.c b/cpus.c
index 1cd9867..83c078e 100644
--- a/cpus.c
+++ b/cpus.c
@@ -778,7 +778,7 @@ static void qemu_tcg_init_cpu_signals(void)

 static QemuMutex qemu_global_mutex;
 static QemuCond qemu_io_proceeded_cond;
-static bool iothread_requesting_mutex;
+static unsigned iothread_requesting_mutex;

 static QemuThread io_thread;

@@ -1115,15 +1115,15 @@ bool qemu_in_vcpu_thread(void)

 void qemu_mutex_lock_iothread(void)
 {
-    if (!tcg_enabled()) {
+    if (!tcg_enabled() || !first_cpu) {
         qemu_mutex_lock(&qemu_global_mutex);
     } else {
-        iothread_requesting_mutex = true;
+        atomic_inc(&iothread_requesting_mutex);
         if (qemu_mutex_trylock(&qemu_global_mutex)) {
             qemu_cpu_kick_thread(first_cpu);
             qemu_mutex_lock(&qemu_global_mutex);
         }
-        iothread_requesting_mutex = false;
+        atomic_dec(&iothread_requesting_mutex);
         qemu_cond_broadcast(&qemu_io_proceeded_cond);
     }
 }


I couldn't reproduce it with stress, but a reboot loop finally triggered
it on Aurelien's images.

Interestingly, the bug has been there forever but was only triggered in
relatively weird cases such as TCG+migration.  My patch just made it
much more visible.

Paolo

> 
> BTW I managed to reproduce the original problem using Aurel's Debian
> images. Could you try and see if you can reproduce the problem as well?
> 
> Images:
> $ wget https://people.debian.org/~aurel32/qemu/mips/vmlinux-3.2.0-4-4kc-malta
> $ wget 
> https://people.debian.org/~aurel32/qemu/mips/debian_squeeze_mips_standard.qcow2
> 
> Run:
> $ qemu-system-mips -M malta -kernel vmlinux-3.2.0-4-4kc-malta -hda
> debian_squeeze_mips_standard.qcow2 -append "root=/dev/sda1
> console=ttyS0" -snapshot -nographic
> 
> debian-mips login: root
> password: root
> address@hidden:~# apt-get install stress
> 
> (and now try to stress a few times, usually after 2 or 3 times QEMU freezes)
> 
> address@hidden:~# stress --timeout 15s --cpu 4 --io 2 --vm 2 --vm-bytes 1M



reply via email to

[Prev in Thread] Current Thread [Next in Thread]