qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>,
	Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] virtio-blk: use aio handler for data plane
Date: Tue, 29 Mar 2016 16:58:34 +0300	[thread overview]
Message-ID: <20160329165700-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <56FA8982.2000404@redhat.com>

On Tue, Mar 29, 2016 at 03:56:18PM +0200, Paolo Bonzini wrote:
> 
> 
> On 29/03/2016 15:42, Michael S. Tsirkin wrote:
> > @@ -262,6 +274,7 @@ void virtio_blk_data_plane_stop(VirtIOBlockDataPlane *s)
> >  
> >      /* Stop notifications for new requests from guest */
> >      virtio_queue_aio_set_host_notifier_handler(s->vq, s->ctx, false, false);
> 
> I think that this should have been ", true, false" even before your
> patch; I'd prefer to fix it even if the problem is latent.

Makes sense - post a patch?

> The patch looks good, and it might even be an API improvement
> independent of Conny's patches.  The reentrancy _is_ hard to understand,
> and eliminating it makes the new API not just a hack.
> 
> In that case I would unify the new function with
> virtio_queue_aio_set_host_notifier_handler.  In other words
> 
> - virtio_queue_aio_set_host_notifier_handler(vq, ctx, NULL) is
> the same as
> 
>      virtio_set_queue_aio(s->vq, NULL);
>      virtio_queue_aio_set_host_notifier_handler(vq, ctx, true, false);
> 
> - virtio_queue_aio_set_host_notifier_handler(vq, ctx, fn) is the same as
> 
>      virtio_queue_aio_set_host_notifier_handler(vq, ctx, true, true);
>      virtio_set_queue_aio(vq, fn);
> 
> Thanks,
> 
> Paolo

In that case, we'll have to also change scsi to use the new API.
A bit more work, to be sure.
Does scsi have the same problem as blk?

> > +    virtio_set_queue_aio(s->vq, NULL);
> >  
> >      /* Drain and switch bs back to the QEMU main loop */
> >      blk_set_aio_context(s->conf->conf.blk, qemu_get_aio_context());

  reply	other threads:[~2016-03-29 13:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29 13:42 [Qemu-devel] [PATCH 0/2] dataplane: fix start/stop races Michael S. Tsirkin
2016-03-29 13:42 ` [Qemu-devel] [PATCH 1/2] virtio: add aio handler Michael S. Tsirkin
2016-03-29 14:19   ` Paolo Bonzini
2016-03-29 13:42 ` [Qemu-devel] [PATCH 2/2] virtio-blk: use aio handler for data plane Michael S. Tsirkin
2016-03-29 13:56   ` Paolo Bonzini
2016-03-29 13:58     ` Michael S. Tsirkin [this message]
2016-03-29 13:59       ` Paolo Bonzini
2016-03-29 14:05   ` Paolo Bonzini
2016-03-29 14:09     ` Michael S. Tsirkin
2016-03-29 14:44       ` Paolo Bonzini
2016-03-29 13:43 ` [Qemu-devel] [PATCH 0/2] dataplane: fix start/stop races Michael S. Tsirkin
2016-03-29 15:06 ` Cornelia Huck
2016-03-29 16:31 ` Christian Borntraeger
2016-03-30  3:04   ` tu bo
2016-03-30  7:32     ` 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=20160329165700-mutt-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).