From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akuAW-0004eS-Bg for qemu-devel@nongnu.org; Tue, 29 Mar 2016 09:58:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akuAS-0007WY-Aq for qemu-devel@nongnu.org; Tue, 29 Mar 2016 09:58:52 -0400 Date: Tue, 29 Mar 2016 16:58:34 +0300 From: "Michael S. Tsirkin" Message-ID: <20160329165700-mutt-send-email-mst@redhat.com> References: <1459258923-10319-1-git-send-email-mst@redhat.com> <1459258923-10319-3-git-send-email-mst@redhat.com> <56FA8982.2000404@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56FA8982.2000404@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/2] virtio-blk: use aio handler for data plane List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Cornelia Huck , Kevin Wolf , qemu-block@nongnu.org, qemu-devel@nongnu.org, Stefan Hajnoczi 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());