From: Avi Kivity <avi@redhat.com>
To: Qing He <qing.he@intel.com>
Cc: Sheng Yang <sheng@linux.intel.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Ingo Molnar <mingo@elte.hu>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH] x86/kvm: Show guest system/user cputime in cpustat
Date: Sat, 13 Mar 2010 10:26:21 +0200 [thread overview]
Message-ID: <4B9B4C2D.90806@redhat.com> (raw)
In-Reply-To: <20100312085321.GA9075@ub-qhe2>
On 03/12/2010 10:53 AM, Qing He wrote:
>
>> When Qing(CCed) was working on nested VMX in the past, he found PV
>> vmread/vmwrite indeed works well(it would write to the virtual vmcs so vmwrite
>> can also benefit). Though compared to old machine(one our internal patch shows
>> improve more than 5%), NHM get less benefit due to the reduced vmexit cost.
>>
>>
> One of the hurdles to PVize vmread/vmwrite is the fact that the memory
> layout of physical vmcs remains unknown. Of course it can use the custom
> vmcs layout utilized by nested virtualization, but that looks a little weird,
> since different nested virtualization implementation may create different
> custom layout.
>
Note we must use a custom layout and cannot depend on the physical
layout, due to live migration. The layout becomes an ABI.
> I once used another approach to partially accelerate the vmread/vmwrite
> in nested virtualization case, which also gives good performance gain (around
> 7% on pre-nehalem, based on this, PV vmread/vmwrite had another 7%). That
> is to make a shortcut to handle EXIT_REASON_VM{READ,WRITE}, without
> even turning on the IF.
>
Interesting. That means our exit path is inefficient; it seems to imply
half the time is spent outside the hardware vmexit path.
A quick profile (on non-Nehalem) shows many atomics and calls into the
lapic, as well as update_cr8_intercept which is sometimes unnecessary;
these could easily be optimized.
Definitely optimizing the non-paravirt path is preferred to adding more
paravirtualization.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
prev parent reply other threads:[~2010-03-13 8:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-11 7:20 [PATCH] x86/kvm: Show guest system/user cputime in cpustat Sheng Yang
2010-03-11 7:36 ` Avi Kivity
2010-03-11 7:46 ` Sheng Yang
2010-03-11 7:50 ` Avi Kivity
2010-03-11 8:21 ` Zhang, Yanmin
2010-03-11 9:17 ` Sheng Yang
2010-03-12 8:53 ` Qing He
2010-03-13 8:26 ` Avi Kivity [this message]
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=4B9B4C2D.90806@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mtosatti@redhat.com \
--cc=qing.he@intel.com \
--cc=sheng@linux.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