From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zrjrg-00086p-Gb for qemu-devel@nongnu.org; Thu, 29 Oct 2015 05:51:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zrjrc-0003jY-GI for qemu-devel@nongnu.org; Thu, 29 Oct 2015 05:51:24 -0400 Received: from mail-pa0-x236.google.com ([2607:f8b0:400e:c03::236]:33830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zrjrc-0003jF-8m for qemu-devel@nongnu.org; Thu, 29 Oct 2015 05:51:20 -0400 Received: by padhk11 with SMTP id hk11so36375869pad.1 for ; Thu, 29 Oct 2015 02:51:19 -0700 (PDT) Sender: Paolo Bonzini References: <1444979273-6587-9-git-send-email-den@openvz.org> <1445530171-20688-1-git-send-email-asmetanin@virtuozzo.com> <563108D9.7000708@redhat.com> <20151029084524.GF2578@rkaganb.sw.ru> From: Paolo Bonzini Message-ID: <5631EC10.8030905@redhat.com> Date: Thu, 29 Oct 2015 10:51:12 +0100 MIME-Version: 1.0 In-Reply-To: <20151029084524.GF2578@rkaganb.sw.ru> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 8/9] kvm/x86: Hyper-V synthetic interrupt controller List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Roman Kagan , Andrey Smetanin , kvm@vger.kernel.org, Gleb Natapov , qemu-devel@nongnu.org, "Denis V. Lunev" , Vitaly Kuznetsov , "K. Y. Srinivasan" On 29/10/2015 09:45, Roman Kagan wrote: > While Andrey is testing it, I'd like to ask similar question re. MSI: > why is there a "shortcut" for KVM_IRQ_ROUTING_MSI case (which we > basically modelled after) when it would probably get handled through > ->set handler in irqfd_inject() too? Because it's a bit faster that way. :) By avoiding the schedule_work, you can improve latency by a few microseconds. It's nice to have it for the VFIO case especially, where everything you do takes you further from hardware performance. However, that shortcut is badly implemented because it lets you do a walk over all CPUs while interrupts are disabled. It should be modified to use kvm_set_msi_inatomic instead of kvm_set_msi (more precisely, I would like to remove kvm_set_msi and keep kvm_arch_irq_update; then kvm_arch_irq_update will call kvm_set_msi_inatomic). I'll post a patch next Monday. You can then benchmark the addition of synthetic interrupts to the atomic-context fast path, and see if it makes a speed difference. Paolo