From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alHWn-0003i6-Ox for qemu-devel@nongnu.org; Wed, 30 Mar 2016 10:55:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alHWk-0004LE-I9 for qemu-devel@nongnu.org; Wed, 30 Mar 2016 10:55:25 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:40868) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alHWk-0004L8-8d for qemu-devel@nongnu.org; Wed, 30 Mar 2016 10:55:22 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 30 Mar 2016 15:55:20 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id C70841B08072 for ; Wed, 30 Mar 2016 15:55:52 +0100 (BST) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u2UEtHPc58130600 for ; Wed, 30 Mar 2016 14:55:17 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u2UEtHVi007527 for ; Wed, 30 Mar 2016 10:55:17 -0400 Date: Wed, 30 Mar 2016 16:55:15 +0200 From: Cornelia Huck Message-ID: <20160330165515.7e903720.cornelia.huck@de.ibm.com> In-Reply-To: <1459342088-24311-6-git-send-email-pbonzini@redhat.com> References: <1459342088-24311-1-git-send-email-pbonzini@redhat.com> <1459342088-24311-6-git-send-email-pbonzini@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/9] virtio: add aio handler List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: borntraeger@de.ibm.com, famz@redhat.com, qemu-devel@nongnu.org, mst@redhat.com On Wed, 30 Mar 2016 14:48:04 +0200 Paolo Bonzini wrote: > From: "Michael S. Tsirkin" > > In addition to handling IO in vcpu thread and > in io thread, blk dataplane introduces yet another mode: > handling it by aio. > > This reuses the same handler as previous modes, > which triggers races as these were not designed to be reentrant. > > As a temporary fix, add a separate handler just for aio, this will make > it possible to disable regular handlers when dataplane is active. > > Signed-off-by: Michael S. Tsirkin > Signed-off-by: Paolo Bonzini > --- > hw/virtio/virtio.c | 36 ++++++++++++++++++++++++++++++++---- > include/hw/virtio/virtio.h | 3 +++ > 2 files changed, 35 insertions(+), 4 deletions(-) > > @@ -1791,14 +1811,22 @@ void virtio_queue_aio_set_host_notifier_handler(VirtQueue *vq, AioContext *ctx, > { > if (assign && set_handler) { > aio_set_event_notifier(ctx, &vq->host_notifier, true, > - virtio_queue_host_notifier_read); > + virtio_queue_host_notifier_aio_read); > } else { > aio_set_event_notifier(ctx, &vq->host_notifier, true, NULL); > } > if (!assign) { > /* Test and clear notifier before after disabling event, > * in case poll callback didn't have time to run. */ > - virtio_queue_host_notifier_read(&vq->host_notifier); > + virtio_queue_host_notifier_aio_read(&vq->host_notifier); Is this function ever called with assign==false anymore after patch 1? > + } > +}