From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1annj2-0000bj-0L for qemu-devel@nongnu.org; Wed, 06 Apr 2016 09:42:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anniy-0004i2-Pm for qemu-devel@nongnu.org; Wed, 06 Apr 2016 09:42:27 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:45587) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anniy-0004hg-GE for qemu-devel@nongnu.org; Wed, 06 Apr 2016 09:42:24 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 Apr 2016 14:42:23 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id E6DC71B0804B for ; Wed, 6 Apr 2016 14:42:58 +0100 (BST) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u36DgK2Y7078358 for ; Wed, 6 Apr 2016 13:42:20 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u36DgJiU003067 for ; Wed, 6 Apr 2016 07:42:20 -0600 Date: Wed, 6 Apr 2016 15:42:17 +0200 From: Cornelia Huck Message-ID: <20160406154217.6270256a.cornelia.huck@de.ibm.com> In-Reply-To: <5704FC68.6030105@redhat.com> References: <1459937788-31904-1-git-send-email-pbonzini@redhat.com> <1459937788-31904-5-git-send-email-pbonzini@redhat.com> <20160406131117.368692e7.cornelia.huck@de.ibm.com> <5704FC68.6030105@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/7] virtio: add aio handler List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: famz@redhat.com, borntraeger@de.ibm.com, mst@redhat.com, qemu-devel@nongnu.org, tubo@linux.vnet.ibm.com, stefanha@redhat.com On Wed, 6 Apr 2016 14:09:12 +0200 Paolo Bonzini wrote: > On 06/04/2016 13:11, Cornelia Huck wrote: > >> > +static void virtio_queue_notify_aio_vq(VirtQueue *vq) > >> > +{ > >> > + if (vq->vring.desc && vq->handle_aio_output) { > >> > + VirtIODevice *vdev = vq->vdev; > >> > + > >> > + trace_virtio_queue_notify(vdev, vq - vdev->vq, vq); > >> > + vq->handle_aio_output(vdev, vq); > >> > + } > >> > +} > >> > + > > So this avoids reentrancy, but might we miss one notify if > > ->handle_aio_output has already been unset? What am I missing? > > Calling the notifier just before unset is handled by using "false, > false" when unsetting the notifier, and only setting > vq->handle_aio_output after the notifier has been unset. Actually, the code is not quite right until the next two patches have been applied, but I think we can live with that. > Patch 7 makes things clearer. That as well.