From mboxrd@z Thu Jan 1 00:00:00 1970 From: Asias He Subject: Re: [PATCH 0/3] virtio: don't poll masked vectors with irqfd Date: Wed, 19 Dec 2012 16:53:22 +0800 Message-ID: <50D18082.50509@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, Marcelo Tosatti , Jan Kiszka , Peter Maydell , kvm@vger.kernel.org To: "Michael S. Tsirkin" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:39457 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752254Ab2LSIu6 (ORCPT ); Wed, 19 Dec 2012 03:50:58 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 12/18/2012 08:39 PM, Michael S. Tsirkin wrote: > At the moment when vector is masked virtio will poll it > in userspace, even if it is handled by irqfd. > This is done in order to update pending bits, but > it's not really required until someone reads the pending bits. > On the other hand this read results in extra io thread wakeups. > > As we only implement the pending bits as a compatibility > feature (read - real drivers don't use it), we can defer > the irqfd poll until the read actually happens. > > This does not seem to affect vhost-net speed > in simple benchmarks but could help block: both > vhost-blk and dataplane when using irqfd, > and I also think this is cleaner than enabling/disabling > notifiers all the time. > > This will also be the basis for future optimizations. > > Michael S. Tsirkin (3): > msi: add API to get notified about pending bit poll > msix: expose access to masked/pending state > virtio-pci: don't poll masked vectors > > hw/pci/msix.c | 19 +++++++++++++++---- > hw/pci/msix.h | 6 +++++- > hw/pci/pci.h | 4 ++++ > hw/vfio_pci.c | 2 +- > hw/virtio-pci.c | 53 +++++++++++++++++++++++++++++++++++++++++------------ > 5 files changed, 66 insertions(+), 18 deletions(-) The performance boost is significant here. It is close to the result of dropping msix_fire_vector_notifier() hack. -- Asias