From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHnjj-0001so-3j for qemu-devel@nongnu.org; Tue, 28 Jun 2016 03:47:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHnjd-0002Xb-VY for qemu-devel@nongnu.org; Tue, 28 Jun 2016 03:47:10 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:46858 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHnjd-0002XB-Lr for qemu-devel@nongnu.org; Tue, 28 Jun 2016 03:47:05 -0400 References: <5770F58F.2080402@kamp.de> <20160627170938.04a7a13c.cornelia.huck@de.ibm.com> <20160628100152-mutt-send-email-mst@redhat.com> <20160628094245.0fefc484.cornelia.huck@de.ibm.com> From: Peter Lieven Message-ID: <57722B75.9090406@kamp.de> Date: Tue, 28 Jun 2016 09:47:01 +0200 MIME-Version: 1.0 In-Reply-To: <20160628094245.0fefc484.cornelia.huck@de.ibm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Regression: virtio-pci: convert to ioeventfd callbacks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck , "Michael S. Tsirkin" Cc: "qemu-devel@nongnu.org" , famz@redhat.com, stefanha@redhat.com Am 28.06.2016 um 09:42 schrieb Cornelia Huck: > On Tue, 28 Jun 2016 10:03:21 +0300 > "Michael S. Tsirkin" wrote: > >> I notice cleanup is a bit weird: >> >> virtio_queue_set_host_notifier_fd_handler(vq, false, false); >> k->ioeventfd_assign(proxy, notifier, n, assign); >> event_notifier_cleanup(notifier); >> >> I think virtio_queue_set_host_notifier_fd_handler should happen >> after ioeventfd_assign for symmetry with init? > Looking at the pre-rework code, ccw used the order now in common code, > while pci and mmio used the order you suggest. > > "Switch the handler back, then unassign the transport's ioeventfd > backing" made more sense to me (regardless of symmetry) - but we might > lose a notification? > > Peter: Can you check whether your problem goes away if you switch the > two lines around? > The problem goes away, but its horribly slow. Maybe the lost notifications you were thinking off. diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c index 1313760..7924a59 100644 --- a/hw/virtio/virtio-bus.c +++ b/hw/virtio/virtio-bus.c @@ -176,9 +176,9 @@ static int set_host_notifier_internal(DeviceState *proxy, VirtioBusState *bus, return r; } } else { - virtio_queue_set_host_notifier_fd_handler(vq, false, false); k->ioeventfd_assign(proxy, notifier, n, assign); event_notifier_cleanup(notifier); + virtio_queue_set_host_notifier_fd_handler(vq, false, false); } return r; } Peter