From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agZWH-0005CR-VF for qemu-devel@nongnu.org; Thu, 17 Mar 2016 11:07:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agZWD-0003J3-L1 for qemu-devel@nongnu.org; Thu, 17 Mar 2016 11:07:25 -0400 Received: from e06smtp05.uk.ibm.com ([195.75.94.101]:59696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agZWD-0003Ih-BM for qemu-devel@nongnu.org; Thu, 17 Mar 2016 11:07:21 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 17 Mar 2016 15:07:17 -0000 References: <1458123018-18651-1-git-send-email-famz@redhat.com> <56E9355A.5070700@redhat.com> <56E93A22.1080102@de.ibm.com> <56E93ECE.10103@redhat.com> <56E9425C.8030201@de.ibm.com> <56E957AD.2050005@redhat.com> <56E961EA.4090908@de.ibm.com> <56EAA170.1000904@linux.vnet.ibm.com> <56EAA576.8020709@de.ibm.com> <56EAC706.2040006@redhat.com> From: Christian Borntraeger Message-ID: <56EAC821.6010703@de.ibm.com> Date: Thu, 17 Mar 2016 16:07:13 +0100 MIME-Version: 1.0 In-Reply-To: <56EAC706.2040006@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/4] Tweaks around virtio-blk start/stop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , tu bo , Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , cornelia.huck@de.ibm.com, Stefan Hajnoczi , qemu-block@nongnu.org, "Michael S. Tsirkin" On 03/17/2016 04:02 PM, Paolo Bonzini wrote: > > > On 17/03/2016 13:39, Christian Borntraeger wrote: >> As an interesting side note, I updated my system from F20 to F23 some days ago >> (after the initial report). While To Bo is still on a F20 system. I was not able >> to reproduce the original crash on f23. but going back to F20 made this >> problem re-appear. >> >> Stack trace of thread 26429: >> #0 0x00000000802008aa tracked_request_begin (qemu-system-s390x) >> #1 0x0000000080203f3c bdrv_co_do_preadv (qemu-system-s390x) >> #2 0x000000008020567c bdrv_co_do_readv (qemu-system-s390x) >> #3 0x000000008025d0f4 coroutine_trampoline (qemu-system-s390x) >> #4 0x000003ff943d150a __makecontext_ret (libc.so.6) >> >> this is with patch 2-4 plus the removal of virtio_queue_host_notifier_read. >> >> Without removing virtio_queue_host_notifier_read, I get the same mutex lockup (as expected). >> >> Maybe we have two independent issues here and this is some old bug in glibc or >> whatever? > > I'm happy to try and reproduce on x86 if you give me some instruction > (RHEL7 should be close enough to Fedora 20). Tu Bo has a standard guest that he starting multiple times. I can trigger some issues by starting 20 guests that only have a kernel (with virtio-blk and bus driver compiled in) and a busybox ramdisk that simply calls reboot. Sooner or later a qemu crashes. This guest has several virtio devices attached as well (partition detection will do minimal reads) ala > > Can you add an assert in virtio_blk_handle_output to catch reentrancy, like Will do. > > diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c > index a7ec572..96ea896 100644 > --- a/hw/block/virtio-blk.c > +++ b/hw/block/virtio-blk.c > @@ -591,6 +591,8 @@ static void virtio_blk_handle_output(VirtIODevice > *vdev, VirtQueue *vq) > return; > } > > + int x = atomic_fetch_inc(&s->test); > + assert(x == 0); > blk_io_plug(s->blk); > > while ((req = virtio_blk_get_request(s))) { > @@ -602,6 +604,7 @@ static void virtio_blk_handle_output(VirtIODevice > *vdev, VirtQueue *vq) > } > > blk_io_unplug(s->blk); > + atomic_dec(&s->test); > } > > static void virtio_blk_dma_restart_bh(void *opaque) > diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h > index ae84d92..6472503 100644 > --- a/include/hw/virtio/virtio-blk.h > +++ b/include/hw/virtio/virtio-blk.h > @@ -48,6 +48,7 @@ typedef struct VirtIOBlock { > BlockBackend *blk; > VirtQueue *vq; > void *rq; > + int test; > QEMUBH *bh; > VirtIOBlkConf conf; > unsigned short sector_mask; > > ? > > Paolo >