kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Ingo Molnar <mingo@elte.hu>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/4] User return notifiers / just-in-time MSR switching for KVM
Date: Sun, 25 Oct 2009 14:23:17 +0200	[thread overview]
Message-ID: <4AE44335.8010804@redhat.com> (raw)
In-Reply-To: <1253105134-8862-1-git-send-email-avi@redhat.com>

On 09/16/2009 03:45 PM, Avi Kivity wrote:
> The various x86 syscall related MSRs (MSR_LSTAR and friends, EFER when SCE
> needs to be updated) are fairly expensive to read or write.  Since different
> operating systems can set different values for these MSRs, KVM needs to reload
> them when switching to a different guest or to the host.
>
> Switching on every guest entry/exit is too expensive, so KVM reloads on
> guest preemption, which is a lot rarer.  Even so, preemption based reload
> is suboptimal:
>
> - if we're switching to a kernel thread and back, there's no need to reload
>    the MSRs.  Examples of kernel threads we're likely to switch to are:
>
>    - the idle task
>    - a threaded interrupt handler
>    - a kernel-mode virtio server (vhost-net)
>
> - if we're switching to a guest running the same OS, the MSRs will have the
>    same values and there's no need to reload them
>
> - if the guest and host run the same OS, again the MSRs need not be reloaded.
>
> This patchset implements just-in-time reloads to defer them to the last
> possible instant.  When we do reload, we check whether the values have in
> fact changed and reload conditionally.
>
> For the just-in-time reloads the first patch implements "user return
> notifiers", a callback invoked just before return to userspace.  This has
> been written so that there is no code impact if KVM is not configured, and
> no runtime impact if KVM is not running.
>
> The patchset improves guest/idle/guest switches by about 2000 cycles.
>
>    

I've applied this to kvm.git master.

-- 
error compiling committee.c: too many arguments to function


      parent reply	other threads:[~2009-10-25 12:23 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-16 12:45 [PATCH 0/4] User return notifiers / just-in-time MSR switching for KVM Avi Kivity
2009-09-16 12:45 ` [PATCH 1/4] core, x86: Add user return notifiers Avi Kivity
2009-09-18 18:14   ` H. Peter Anvin
2009-09-19  6:40     ` [PATCH v2] " Avi Kivity
2009-09-22  9:25       ` Avi Kivity
2009-09-22  9:37         ` Arjan van de Ven
2009-09-22  9:48           ` Avi Kivity
2009-09-22 14:32         ` Ingo Molnar
2009-09-22 14:45           ` Avi Kivity
2009-09-22 15:50             ` Avi Kivity
2009-09-22 17:08               ` Avi Kivity
2009-09-22 15:19           ` H. Peter Anvin
2009-10-01 15:21             ` Avi Kivity
2009-10-01 15:25               ` H. Peter Anvin
2009-10-01 15:30                 ` Avi Kivity
2009-10-01 18:33                   ` H. Peter Anvin
2009-09-22 16:50           ` Peter Zijlstra
2009-09-22 16:52             ` Avi Kivity
2009-09-22 16:55               ` Peter Zijlstra
2009-09-22 17:05                 ` Avi Kivity
2009-09-22 18:06           ` Peter Zijlstra
2009-09-19  6:40     ` [PATCH 1/4] " Avi Kivity
2009-09-16 12:45 ` [PATCH 2/4] KVM: VMX: Move MSR_KERNEL_GS_BASE out of the vmx autoload msr area Avi Kivity
2009-09-16 12:45 ` [PATCH 3/4] KVM: x86 shared msr infrastructure Avi Kivity
2009-09-16 21:21   ` Marcelo Tosatti
2009-09-16 21:24     ` Avi Kivity
2009-09-16 12:45 ` [PATCH 4/4] KVM: VMX: Use " Avi Kivity
2009-10-25 12:23 ` 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=4AE44335.8010804@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 \
    /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;
as well as URLs for NNTP newsgroup(s).