All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	tu bo <tubo@linux.vnet.ibm.com>, Fam Zheng <famz@redhat.com>,
	qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	cornelia.huck@de.ibm.com, Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-block@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 0/4] Tweaks around virtio-blk start/stop
Date: Thu, 17 Mar 2016 16:07:13 +0100	[thread overview]
Message-ID: <56EAC821.6010703@de.ibm.com> (raw)
In-Reply-To: <56EAC706.2040006@redhat.com>

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 

  <qemu:commandline>
    <qemu:arg value='-drive'/>
    <qemu:arg value='driver=null-co,id=null1,if=none,size=100G'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='virtio-blk-ccw,scsi=off,drive=null1,serial=null1,iothread=iothread1'/>
    <qemu:arg value='-drive'/>
    <qemu:arg value='driver=null-co,id=null2,if=none,size=100G'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='virtio-blk-ccw,scsi=off,drive=null2,serial=null2,iothread=iothread1'/>
    <qemu:arg value='-drive'/>
    <qemu:arg value='driver=null-co,id=null3,if=none,size=100G'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='virtio-blk-ccw,scsi=off,drive=null3,serial=null3,iothread=iothread1'/>
    <qemu:arg value='-drive'/>
    <qemu:arg value='driver=null-co,id=null4,if=none,size=100G'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='virtio-blk-ccw,scsi=off,drive=null4,serial=null4,iothread=iothread1'/>

    <qemu:arg value='-drive'/>
    <qemu:arg value='driver=null-co,id=null5,if=none,size=100G'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='virtio-blk-ccw,scsi=off,drive=null5,serial=null5,iothread=iothread1'/>
    <qemu:arg value='-drive'/>
    <qemu:arg value='driver=null-co,id=null6,if=none,size=100G'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='virtio-blk-ccw,scsi=off,drive=null6,serial=null6,iothread=iothread1'/>
    <qemu:arg value='-drive'/>
    <qemu:arg value='driver=null-co,id=null7,if=none,size=100G'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='virtio-blk-ccw,scsi=off,drive=null7,serial=null7,iothread=iothread1'/>
    <qemu:arg value='-drive'/>
    <qemu:arg value='driver=null-co,id=null8,if=none,size=100G'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='virtio-blk-ccw,scsi=off,drive=null8,serial=null8,iothread=iothread1'/>


  </qemu:commandline>





> 
> 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
> 

  reply	other threads:[~2016-03-17 15:07 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 10:10 [Qemu-devel] [PATCH 0/4] Tweaks around virtio-blk start/stop Fam Zheng
2016-03-16 10:10 ` [Qemu-devel] [PATCH 1/4] block: Use drained section in bdrv_set_aio_context Fam Zheng
2016-03-16 10:27   ` Paolo Bonzini
2016-03-16 10:51     ` Fam Zheng
2016-03-16 10:10 ` [Qemu-devel] [PATCH 2/4] block-backend: Introduce blk_drained_begin/end Fam Zheng
2016-03-16 10:10 ` [Qemu-devel] [PATCH 3/4] virtio-blk: Use blk_drained_begin/end around dataplane stop Fam Zheng
2016-03-16 10:10 ` [Qemu-devel] [PATCH 4/4] virtio-blk: Clean up start/stop with mutex and BH Fam Zheng
2016-03-17 15:00   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-03-17 15:07     ` Paolo Bonzini
2016-03-22 12:52       ` Fam Zheng
2016-03-22 18:05         ` Paolo Bonzini
2016-03-23  8:10           ` Cornelia Huck
2016-03-23  9:08             ` Paolo Bonzini
2016-03-23  9:12               ` Christian Borntraeger
2016-03-24  8:19                 ` tu bo
2016-03-24  8:32                   ` Cornelia Huck
2016-03-24  8:47                     ` Cornelia Huck
2016-03-24  9:31                       ` Cornelia Huck
2016-03-16 10:28 ` [Qemu-devel] [PATCH 0/4] Tweaks around virtio-blk start/stop Paolo Bonzini
2016-03-16 10:49   ` Christian Borntraeger
2016-03-16 11:09     ` Paolo Bonzini
2016-03-16 11:24       ` Christian Borntraeger
2016-03-16 12:55         ` Paolo Bonzini
2016-03-16 13:38           ` Christian Borntraeger
2016-03-16 13:45             ` Paolo Bonzini
2016-03-17  0:39               ` Fam Zheng
2016-03-17 11:03                 ` tu bo
2016-03-21 10:57                   ` Fam Zheng
2016-03-21 11:15                     ` Cornelia Huck
2016-03-21 12:45                       ` Fam Zheng
2016-03-21 13:02                         ` Cornelia Huck
2016-03-21 23:45                           ` Fam Zheng
2016-03-22  8:06                             ` Cornelia Huck
2016-03-22  7:10                     ` tu bo
2016-03-22  7:18                       ` Fam Zheng
2016-03-22  9:07                         ` Cornelia Huck
2016-03-22  9:46                           ` Paolo Bonzini
2016-03-22 11:59                             ` Cornelia Huck
2016-03-22 12:11                               ` Paolo Bonzini
2016-03-22 12:54                                 ` Cornelia Huck
2016-03-17 12:22             ` tu bo
2016-03-17 12:39               ` Christian Borntraeger
2016-03-17 13:02                 ` Cornelia Huck
2016-03-17 15:02                 ` Paolo Bonzini
2016-03-17 15:07                   ` Christian Borntraeger [this message]
2016-03-17 15:15                   ` Christian Borntraeger
2016-03-17 15:16                     ` Christian Borntraeger
2016-03-17 16:08                       ` Christian Borntraeger
2016-03-18 15:03                         ` Paolo Bonzini
2016-03-21  9:42                           ` Fam Zheng
2016-03-21 11:10                             ` Christian Borntraeger
2016-03-21 12:17                             ` Cornelia Huck
2016-03-21 13:47                           ` TU BO
2016-03-21 13:54                             ` Paolo Bonzini
2016-03-21 14:19                               ` Cornelia Huck
2016-03-22  0:31                                 ` Fam Zheng
2016-03-16 11:32       ` Cornelia Huck
2016-03-16 11:48         ` Paolo Bonzini
2016-03-16 11:56           ` Cornelia Huck
2016-03-16 11:59             ` Paolo Bonzini
2016-03-16 12:22               ` Cornelia Huck
2016-03-16 12:32                 ` Paolo Bonzini
2016-03-16 12:42                   ` Cornelia Huck
2016-03-16 12:49                     ` Paolo Bonzini
2016-03-16 13:04                       ` Cornelia Huck
2016-03-16 13:10                         ` Paolo Bonzini
2016-03-16 13:14                           ` Cornelia Huck
2016-03-16 13:15                             ` Paolo Bonzini
2016-03-16 11:52         ` Cornelia Huck
2016-03-16 11:54           ` Paolo Bonzini

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=56EAC821.6010703@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=tubo@linux.vnet.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.