[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
- [Qemu-devel] [PULL 04/21] vhost-scsi: expose the TYPE_FW_PATH_PROVIDER interface, (continued)
- [Qemu-devel] [PULL 04/21] vhost-scsi: expose the TYPE_FW_PATH_PROVIDER interface, Paolo Bonzini, 2015/02/16
- [Qemu-devel] [PULL 06/21] vhost-scsi: set the bootable value of channel/target/lun, Paolo Bonzini, 2015/02/16
- [Qemu-devel] [PULL 07/21] rcu: do not let RCU callbacks pile up indefinitely, Paolo Bonzini, 2015/02/16
- [Qemu-devel] [PULL 05/21] vhost-scsi: add a property for booting, Paolo Bonzini, 2015/02/16
- [Qemu-devel] [PULL 01/21] kvm_stat: Add kvm_exit reasons for aarch64, Paolo Bonzini, 2015/02/16
- [Qemu-devel] [PULL 08/21] rcu: run RCU callbacks under the BQL, Paolo Bonzini, 2015/02/16
[Qemu-devel] [PULL 10/21] pcie: remove mmconfig memory leak and wrap mmconfig update with transaction, Paolo Bonzini, 2015/02/16
[Qemu-devel] [PULL 11/21] pci: split shpc_cleanup and shpc_free, Paolo Bonzini, 2015/02/16
[Qemu-devel] [PULL 12/21] docs: clarify memory region lifecycle, Paolo Bonzini, 2015/02/16
[Qemu-devel] [PULL 14/21] exec: make iotlb RCU-friendly, Paolo Bonzini, 2015/02/16
[Qemu-devel] [PULL 15/21] exec: RCUify AddressSpaceDispatch, Paolo Bonzini, 2015/02/16
[Qemu-devel] [PULL 09/21] memory: keep the owner of the AddressSpace alive until do_address_space_destroy, Paolo Bonzini, 2015/02/16
[Qemu-devel] [PULL 13/21] exec: introduce cpu_reload_memory_map, Paolo Bonzini, 2015/02/16
[Qemu-devel] [PULL 16/21] rcu: introduce RCU-enabled QLIST, Paolo Bonzini, 2015/02/16
[Qemu-devel] [PULL 19/21] cosmetic changes preparing for the following patches, Paolo Bonzini, 2015/02/16
[Qemu-devel] [PULL 20/21] exec: convert ram_list to QLIST, Paolo Bonzini, 2015/02/16