From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 0/8] use jump labels to streamline common APIC configuration Date: Mon, 6 Aug 2012 11:52:17 +0300 Message-ID: <20120806085217.GU27579@redhat.com> References: <1344171513-4659-1-git-send-email-gleb@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, avi@redhat.com, mtosatti@redhat.com To: Eric Northup Return-path: Received: from mx1.redhat.com ([209.132.183.28]:52022 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753792Ab2HFIwT (ORCPT ); Mon, 6 Aug 2012 04:52:19 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Aug 05, 2012 at 12:30:49PM -0700, Eric Northup wrote: > On Sun, Aug 5, 2012 at 5:58 AM, Gleb Natapov wrote: > > APIC code has a lot of checks for apic presence and apic HW/SW enable > > state. Most common configuration is when each vcpu has in kernel apic > > and it is fully enabled. This path series uses jump labels to turn checks > > to nops in the common case. > > What is the target workload and how does the performance compare? Since those patches micro optimize interrupt injection path workload with a lot of interrupts and a lot of cpus is the target workload. I ran a simple test that transfers big file from gust (with 16 vcpus) to a host. The workload generates ~40000 interrupt per second (this is with userspace networking). Using perf I checked how functions affected by the change perform with and without the patches: Without: 0.85% kvm_apic_present 0.45% __apic_accept_irq 0.30% kvm_apic_has_interrupt 0.20% kvm_irq_delivery_to_apic 0.16% apic_has_pending_timer 0.09% apic_mmio_write 0.04% kvm_apic_accept_pic_intr 0.04% kvm_lapic_get_cr8 0.04% kvm_lapic_enabled With: 0.61% kvm_irq_delivery_to_apic 0.49% __apic_accept_irq 0.12% apic_has_pending_timer 0.11% kvm_apic_has_interrupt 0.04% kvm_apic_accept_pic_intr 0.03% apic_mmio_write 0.02% kvm_lapic_get_cr8 > As > a naive question, how different is it than just using gcc branch > hints? > If I add likely() annotations to kvm_apic_present() gcc generates exactly same code. -- Gleb.