From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlHnP-0002N8-0K for qemu-devel@nongnu.org; Wed, 19 Dec 2012 06:26:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TlHnL-00032D-2H for qemu-devel@nongnu.org; Wed, 19 Dec 2012 06:26:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:1955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlHnK-000329-R7 for qemu-devel@nongnu.org; Wed, 19 Dec 2012 06:26:38 -0500 Date: Wed, 19 Dec 2012 13:29:46 +0200 From: "Michael S. Tsirkin" Message-ID: <20121219112946.GC7742@redhat.com> References: <50D18082.50509@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50D18082.50509@redhat.com> Subject: Re: [Qemu-devel] [PATCH 0/3] virtio: don't poll masked vectors with irqfd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Asias He Cc: Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org, Peter Maydell On Wed, Dec 19, 2012 at 04:53:22PM +0800, Asias He wrote: > 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. Okay great. I have one other last optimization up my sleeve, that should hopefully make it as fast as with the hack. > -- > Asias