Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933975AbbDWKkb (ORCPT ); Thu, 23 Apr 2015 06:40:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36151 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933398AbbDWKk3 (ORCPT ); Thu, 23 Apr 2015 06:40:29 -0400 Message-ID: <5538CC15.4010005@redhat.com> Date: Thu, 23 Apr 2015 12:40:21 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Liang Li , kvm@vger.kernel.org, linux-kernel@vger.kernel.org CC: gleb@kernel.org, Marcelo Tosatti , tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, joro@8bytes.org, yang.z.zhang@intel.com, Xudong Hao Subject: Re: [v6] kvm/fpu: Enable fully eager restore kvm FPU References: <1429823583-3226-1-git-send-email-liang.z.li@intel.com> In-Reply-To: <1429823583-3226-1-git-send-email-liang.z.li@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1593 Lines: 42 On 23/04/2015 23:13, Liang Li wrote: > Romove lazy FPU logic and use eager FPU entirely. Eager FPU does > not have performance regression, and it can simplify the code. > > When compiling kernel on westmere, the performance of eager FPU > is about 0.4% faster than lazy FPU. > > Signed-off-by: Liang Li > Signed-off-by: Xudong Hao A patch like this requires much more benchmarking than what you have done. First, what guest did you use? A modern Linux guest will hardly ever exit to userspace: the scheduler uses the TSC deadline timer, which is handled in the kernel; the clocksource uses the TSC; virtio-blk devices are kicked via ioeventfd. What happens if you time a Windows guest (without any Hyper-V enlightenments), or if you use clocksource=acpi_pm? Second, "0.4%" by itself may not be statistically significant. How did you gather the result? How many times did you run the benchmark? Did the guest report any stolen time? And finally, even if the patch was indeed a performance improvement, there is much more that you can remove. fpu_active is always 1, vmx_fpu_activate only has one call site that can be simplified just to vcpu->arch.cr0_guest_owned_bits = X86_CR0_TS; vmcs_writel(CR0_GUEST_HOST_MASK, ~vcpu->arch.cr0_guest_owned_bits); and so on. Paolo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/