[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4B9B4C2D.90806@redhat.com>
Date: Sat, 13 Mar 2010 10:26:21 +0200
From: Avi Kivity <avi@...hat.com>
To: Qing He <qing.he@...el.com>
CC: Sheng Yang <sheng@...ux.intel.com>,
Marcelo Tosatti <mtosatti@...hat.com>,
Ingo Molnar <mingo@...e.hu>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>
Subject: Re: [PATCH] x86/kvm: Show guest system/user cputime in cpustat
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists