From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: Re: [RFC] VMX CR3 cache Date: Tue, 29 Jan 2008 09:54:27 +0100 Message-ID: <479EE9C3.8000007@redhat.com> References: <20080128160444.GA3821@dmt> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel , Avi Kivity To: Marcelo Tosatti Return-path: In-Reply-To: <20080128160444.GA3821@dmt> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Marcelo Tosatti wrote: > Hi, > > The CR3 cache feature of VMX CPU's does not seem to increase > context switch performance significantly as it did in the original > implementation (http://lkml.org/lkml/2007/1/5/205). > > The following is similar to the original, but it also caches roots for > 4-level pagetables on x86-64, and clearing the cache is only performed > in zap_page() instead of on every pagefault. Hmm, what kvm version is this against? latest git I guess? After applying to kvm-60 (and fixing up some trivial rejects) it doesn't build. > Nowhere near the results achieved earlier (and kernel compilation and > httperf seems slightly slower, probably due to paravirt overhead). Even if it it doesn't help much on native: With xenner it probably gives a nice speedup especially on 64 bit where each guest syscall involves a cr3 switch (not benchmarked yet though). > #ifdef __KERNEL__ > #include > > -#define KVM_PARA_FEATURES (1UL << KVM_FEATURE_NOP_IO_DELAY) > +#define KVM_PARA_FEATURES ((1UL << KVM_FEATURE_NOP_IO_DELAY) | \ > + (1UL << KVM_FEATURE_CR3_CACHE)) > + > +#define KVM_MSR_SET_CR3_CACHE 0x87655678 > + > +#define KVM_CR3_CACHE_SIZE 4 > + > +struct kvm_cr3_cache_entry { > + u64 guest_cr3; > + u64 host_cr3; > +}; > + > +struct kvm_cr3_cache { > + struct kvm_cr3_cache_entry entry[KVM_CR3_CACHE_SIZE]; > + u32 max_idx; > +}; Can you move the structs out of #ifdef __KERNEL__ please? thanks, Gerd ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/