From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Srmsq-0004Li-Vz for qemu-devel@nongnu.org; Thu, 19 Jul 2012 05:19:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Srmso-000825-CX for qemu-devel@nongnu.org; Thu, 19 Jul 2012 05:18:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Srmso-00081z-3L for qemu-devel@nongnu.org; Thu, 19 Jul 2012 05:18:54 -0400 Date: Thu, 19 Jul 2012 12:19:23 +0300 From: "Michael S. Tsirkin" Message-ID: <20120719091923.GE20120@redhat.com> References: <1342624074-24650-1-git-send-email-stefanha@linux.vnet.ibm.com> <1342624074-24650-19-git-send-email-stefanha@linux.vnet.ibm.com> <20120718154021.GD1777@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [RFC v9 18/27] virtio-blk: Call ioctl() directly instead of irqfd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi , kvm@vger.kernel.org, qemu-devel@nongnu.org, Khoa Huynh , Paolo Bonzini , Asias He On Thu, Jul 19, 2012 at 10:11:49AM +0100, Stefan Hajnoczi wrote: > On Wed, Jul 18, 2012 at 4:40 PM, Michael S. Tsirkin wrote: > > On Wed, Jul 18, 2012 at 04:07:45PM +0100, Stefan Hajnoczi wrote: > >> Optimize for the MSI-X enabled and vector unmasked case where it is > >> possible to issue the KVM ioctl() directly instead of using irqfd. > > > > Why? Is an ioctl faster? > > I have no benchmark results comparing irqfd against direct ioctl. It > would be interesting to know if this "optimization" is worthwhile and > how much of a win it is. > > The reasoning is that the irqfd code path signals an eventfd and then > kvm.ko's poll handler injects the interrupt. The ioctl calls straight > into kvm.ko and skips the signalling/poll step. > > Stefan Polling is done in kernel so at least for MSI it's just a function call. In fact ATM irqfd is more optimized. Maybe it's faster for level IRQs but do we really care? -- MST