From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Hajnoczi Subject: Re: [Qemu-devel] [RFC v9 18/27] virtio-blk: Call ioctl() directly instead of irqfd Date: Thu, 19 Jul 2012 10:11:49 +0100 Message-ID: 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=ISO-8859-1 Cc: Stefan Hajnoczi , Kevin Wolf , Anthony Liguori , kvm@vger.kernel.org, qemu-devel@nongnu.org, Khoa Huynh , Paolo Bonzini , Asias He To: "Michael S. Tsirkin" Return-path: Received: from mail-lb0-f174.google.com ([209.85.217.174]:58907 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753585Ab2GSJLv (ORCPT ); Thu, 19 Jul 2012 05:11:51 -0400 Received: by lbbgm6 with SMTP id gm6so3312682lbb.19 for ; Thu, 19 Jul 2012 02:11:49 -0700 (PDT) In-Reply-To: <20120718154021.GD1777@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Srmm5-0001Ao-Hg for qemu-devel@nongnu.org; Thu, 19 Jul 2012 05:11:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Srmlz-0006Gf-Le for qemu-devel@nongnu.org; Thu, 19 Jul 2012 05:11:57 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:45886) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Srmlz-0006GK-Cm for qemu-devel@nongnu.org; Thu, 19 Jul 2012 05:11:51 -0400 Received: by lbok6 with SMTP id k6so3774430lbo.4 for ; Thu, 19 Jul 2012 02:11:49 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20120718154021.GD1777@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> Date: Thu, 19 Jul 2012 10:11:49 +0100 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 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: "Michael S. Tsirkin" Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi , kvm@vger.kernel.org, qemu-devel@nongnu.org, Khoa Huynh , Paolo Bonzini , Asias He 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