From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anmGv-0002Sw-Rj for qemu-devel@nongnu.org; Wed, 06 Apr 2016 08:09:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anmGs-0007gZ-LF for qemu-devel@nongnu.org; Wed, 06 Apr 2016 08:09:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40566) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anmGs-0007g3-Fm for qemu-devel@nongnu.org; Wed, 06 Apr 2016 08:09:18 -0400 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> From: Paolo Bonzini Message-ID: <5704FC68.6030105@redhat.com> Date: Wed, 6 Apr 2016 14:09:12 +0200 MIME-Version: 1.0 In-Reply-To: <20160406131117.368692e7.cornelia.huck@de.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 4/7] virtio: add aio handler List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: famz@redhat.com, borntraeger@de.ibm.com, mst@redhat.com, qemu-devel@nongnu.org, tubo@linux.vnet.ibm.com, stefanha@redhat.com 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 =3D 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. Patch 7 makes things clearer. Paolo