All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Marcelo Tosatti <marcelo-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>
Cc: kvm-devel
	<kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Subject: Re: [RFC] VMX CR3 cache
Date: Tue, 29 Jan 2008 09:54:27 +0100	[thread overview]
Message-ID: <479EE9C3.8000007@redhat.com> (raw)
In-Reply-To: <20080128160444.GA3821@dmt>

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 <asm/processor.h>
>  
> -#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/

  parent reply	other threads:[~2008-01-29  8:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-28 16:04 [RFC] VMX CR3 cache Marcelo Tosatti
2008-01-28 17:17 ` Ingo Molnar
     [not found]   ` <20080128171734.GA19705-X9Un+BFzKDI@public.gmane.org>
2008-01-28 17:35     ` Marcelo Tosatti
2008-01-28 17:37       ` Ingo Molnar
     [not found]         ` <20080128173707.GB22487-X9Un+BFzKDI@public.gmane.org>
2008-01-28 18:17           ` Marcelo Tosatti
2008-01-28 17:23 ` Avi Kivity
2008-01-29  8:54 ` Gerd Hoffmann [this message]
     [not found]   ` <479EE9C3.8000007-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2008-01-29 10:28     ` Gerd Hoffmann
     [not found]       ` <479EFFB0.1000700-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2008-01-29 10:32         ` Gerd Hoffmann
2008-01-29 12:33         ` Marcelo Tosatti
2008-01-30  8:26           ` Gerd Hoffmann
     [not found]             ` <47A034CD.9010708-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2008-01-30  9:18               ` Gerd Hoffmann
     [not found]                 ` <47A040E3.7000207-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2008-01-30 10:10                   ` Avi Kivity
     [not found]                     ` <47A04D1C.4090505-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-30 12:05                       ` Gerd Hoffmann
2008-01-30 13:25               ` Marcelo Tosatti

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=479EE9C3.8000007@redhat.com \
    --to=kraxel-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=marcelo-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.