From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alI6B-0001fp-VJ for qemu-devel@nongnu.org; Wed, 30 Mar 2016 11:32:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alI67-0006EE-U3 for qemu-devel@nongnu.org; Wed, 30 Mar 2016 11:31:59 -0400 Received: from e06smtp07.uk.ibm.com ([195.75.94.103]:54872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alI67-0006Dq-Kr for qemu-devel@nongnu.org; Wed, 30 Mar 2016 11:31:55 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 30 Mar 2016 16:31:54 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 300411B0805F for ; Wed, 30 Mar 2016 16:32:23 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u2UFVlUj65863756 for ; Wed, 30 Mar 2016 15:31:48 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u2UFVlR2010499 for ; Wed, 30 Mar 2016 09:31:47 -0600 Date: Wed, 30 Mar 2016 17:31:45 +0200 From: Cornelia Huck Message-ID: <20160330173145.265594fd.cornelia.huck@de.ibm.com> In-Reply-To: <1459342088-24311-8-git-send-email-pbonzini@redhat.com> References: <1459342088-24311-1-git-send-email-pbonzini@redhat.com> <1459342088-24311-8-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 7/9] virtio-scsi: use aio handler for data plane 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:06 +0200 Paolo Bonzini wrote: > In addition to handling IO in vcpu thread and in io thread, 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. > > Use a separate handler just for aio, and disable regular handlers when > dataplane is active. > > Signed-off-by: Paolo Bonzini > --- > hw/scsi/virtio-scsi-dataplane.c | 43 ++++++++++++++++++++++++--- > hw/scsi/virtio-scsi.c | 65 ++++++++++++++++++++++++++++------------- > include/hw/virtio/virtio-scsi.h | 6 ++-- > 3 files changed, 86 insertions(+), 28 deletions(-) > > +static int virtio_scsi_vring_init(VirtIOSCSI *s, VirtQueue *vq, int n, > + void (*fn)(VirtIODevice *vdev, VirtQueue *vq)) This function has been sadly misnamed since dataplane does not set up its own vrings anymore. Maybe it should be called virtio_scsi_vq_notifier_init() or so. > { > BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(s))); > VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus); Reviewed-by: Cornelia Huck