Received: from eggs.gnu.org ([2001:4830:134:3::10]:36793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIHGW-0001Bb-NJ for qemu-devel@nongnu.org; Thu, 23 Jul 2015 10:14:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZIHGQ-0002Ey-63 for qemu-devel@nongnu.org; Thu, 23 Jul 2015 10:14:28 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:45655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIHGP-0002Em-Te for qemu-devel@nongnu.org; Thu, 23 Jul 2015 10:14:22 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 23 Jul 2015 15:14:20 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id CC5E72190023 for ; Thu, 23 Jul 2015 15:13:52 +0100 (BST) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t6NEEGwh21692458 for ; Thu, 23 Jul 2015 14:14:16 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t6NEEF8S010433 for ; Thu, 23 Jul 2015 08:14:15 -0600 Date: Thu, 23 Jul 2015 16:14:13 +0200 From: Cornelia Huck Message-ID: <20150723161413.15ec718a.cornelia.huck@de.ibm.com> In-Reply-To: <1437565425-29861-6-git-send-email-stefanha@redhat.com> References: <1437565425-29861-1-git-send-email-stefanha@redhat.com> <1437565425-29861-6-git-send-email-stefanha@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL v2 for-2.4 v2 5/7] AioContext: fix broken ctx->dispatching optimization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Stefan Hajnoczi , Christian Borntraeger On Wed, 22 Jul 2015 12:43:43 +0100 Stefan Hajnoczi wrote: > From: Paolo Bonzini > > This patch rewrites the ctx->dispatching optimization, which was the cause > of some mysterious hangs that could be reproduced on aarch64 KVM only. > The hangs were indirectly caused by aio_poll() and in particular by > flash memory updates's call to blk_write(), which invokes aio_poll(). > Fun stuff: they had an extremely short race window, so much that > adding all kind of tracing to either the kernel or QEMU made it > go away (a single printf made it half as reproducible). Sadly, this commit seems to *introduce* hangs on my s390x setup - i.e. the guest does not react at all. Thread 1 seems to be stuck in dataplane setup: (gdb) bt #0 0x000003fffc5871b4 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x000000008024cfca in qemu_cond_wait (cond=cond@entry=0x9717d950, mutex=mutex@entry=0x9717d920) at /data/git/yyy/qemu/util/qemu-thread-posix.c:132 #2 0x000000008025e83a in rfifolock_lock (r=0x9717d920) at /data/git/yyy/qemu/util/rfifolock.c:59 #3 0x00000000801b78fa in aio_context_acquire (ctx=) at /data/git/yyy/qemu/async.c:331 #4 0x000000008007ceb4 in virtio_blk_data_plane_start (s=0x9717d710) at /data/git/yyy/qemu/hw/block/dataplane/virtio-blk.c:285 #5 0x000000008007c64a in virtio_blk_handle_output (vdev=, vq=) at /data/git/yyy/qemu/hw/block/virtio-blk.c:599 #6 0x00000000801c56dc in qemu_iohandler_poll (pollfds=0x97142800, ret=ret@entry=1) at /data/git/yyy/qemu/iohandler.c:126 #7 0x00000000801c5178 in main_loop_wait (nonblocking=) at /data/git/yyy/qemu/main-loop.c:494 #8 0x0000000080013ee2 in main_loop () at /data/git/yyy/qemu/vl.c:1902 #9 main (argc=, argv=, envp=) at /data/git/yyy/qemu/vl.c:4653 I've stripped down the setup to the following commandline: /data/git/yyy/qemu/build/s390x-softmmu/qemu-system-s390x -machine s390-ccw-virtio-2.4,accel=kvm,usb=off -m 1024 -smp 4,sockets=4,cores=1,threads=1 -nographic -drive file=/dev/sda,if=none,id=drive-virtio-disk0,format=raw,serial=ccwzfcp1,cache=none,aio=native -device virtio-blk-ccw,scsi=off,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1,x-data-plane=on Instant hang for me :(