From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v3 8/9] kvm/x86: Hyper-V synthetic interrupt controller Date: Thu, 29 Oct 2015 10:51:12 +0100 Message-ID: <5631EC10.8030905@redhat.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit To: Roman Kagan , Andrey Smetanin , kvm@vger.kernel.org, Gleb Natapov , qemu-devel@nongnu.org, "Denis V. Lunev" , Vitaly Kuznetsov , "K. Y. Srinivasan" Return-path: Received: from mail-pa0-f45.google.com ([209.85.220.45]:32860 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753889AbbJ2JvT (ORCPT ); Thu, 29 Oct 2015 05:51:19 -0400 Received: by padhy1 with SMTP id hy1so30388977pad.0 for ; Thu, 29 Oct 2015 02:51:19 -0700 (PDT) In-Reply-To: <20151029084524.GF2578@rkaganb.sw.ru> Sender: kvm-owner@vger.kernel.org List-ID: 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