public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Liang Li <liang.z.li@intel.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: gleb@kernel.org, Marcelo Tosatti <mtosatti@redhat.com>,
	tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
	x86@kernel.org, joro@8bytes.org, yang.z.zhang@intel.com,
	Xudong Hao <xudong.hao@intel.com>
Subject: Re: [v6] kvm/fpu: Enable fully eager restore kvm FPU
Date: Thu, 23 Apr 2015 12:40:21 +0200	[thread overview]
Message-ID: <5538CC15.4010005@redhat.com> (raw)
In-Reply-To: <1429823583-3226-1-git-send-email-liang.z.li@intel.com>



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 <liang.z.li@intel.com>
> Signed-off-by: Xudong Hao <xudong.hao@intel.com>

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

  reply	other threads:[~2015-04-23 10:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 21:13 [v6] kvm/fpu: Enable fully eager restore kvm FPU Liang Li
2015-04-23 10:40 ` Paolo Bonzini [this message]
2015-04-23 11:25   ` Jan Kiszka
2015-04-23 15:28 ` Dave Hansen
2015-04-23 20:28   ` H. Peter Anvin
2015-04-24  1:16     ` Zhang, Yang Z
2015-04-24  7:44       ` Paolo Bonzini
2015-04-24  7:46         ` Zhang, Yang Z
2015-04-24  7:55           ` Paolo Bonzini
2015-04-24  8:08             ` Zhang, Yang Z
2015-04-23 22:57 ` Wanpeng Li
2015-04-24  2:21   ` Rik van Riel
2015-04-23 23:17 ` Wanpeng Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5538CC15.4010005@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=gleb@kernel.org \
    --cc=hpa@zytor.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=liang.z.li@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xudong.hao@intel.com \
    --cc=yang.z.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox