From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org>
Cc: kvm-devel <kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: Re: [RFT] mmu optimizations branch
Date: Wed, 03 Jan 2007 12:16:07 +0200 [thread overview]
Message-ID: <459B8267.5080000@qumranet.com> (raw)
In-Reply-To: <20070103100235.GA17168-X9Un+BFzKDI@public.gmane.org>
Ingo Molnar wrote:
> * Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
>
>
>>> actually, the VM entry+exit cost on this CPU is around 3-4
>>> microseconds, so it's still 2 VM exits per context switch.
>>>
>>> I debugged this a bit, and what happens is that when Linux does a
>>> task-switch it does a cr3 load /and/ a write (look at __flush_tlb())
>>> - and both are causing a vm exit!
>>>
>>> I have started paravirtualizing the Linux kernel for KVM. I have
>>> eliminated the cr3 load from the Linux kernel via paravirtualization
>>> and that way lat_ctx shows a ~5-6 usecs context-switch cost. That's
>>> pretty good i think, compared to the 2-3 usecs of native. I'll send
>>> patches for this tomorrow.
>>>
>> Does this really call for parvirtualization? Caching the old cr3 value
>> will work for native as well.
>>
>
> it's already cached (and my changes use that cached value), but it (used
> to be) faster/smaller to just move from cr3 than to dereference down to
> the cached pgd pointer, because we used to inline those instructions
> heavily. But i agree that in the current kernel it's probably worth
> doing this for native too - i'll cook up a patch for upstream.
>
>
Ok.
A question. What's __flush_tlb() doing in the context switch path?
Shouldn't it just load the new cr3 and be done with it?
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
next prev parent reply other threads:[~2007-01-03 10:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-01 10:32 [RFT] mmu optimizations branch Avi Kivity
[not found] ` <4598E33B.608-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-02 16:11 ` Ingo Molnar
[not found] ` <20070102161117.GA3306-X9Un+BFzKDI@public.gmane.org>
2007-01-02 16:32 ` Avi Kivity
[not found] ` <459A8909.7020600-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-02 16:49 ` Ingo Molnar
[not found] ` <20070102164912.GA25271-X9Un+BFzKDI@public.gmane.org>
2007-01-02 17:07 ` Avi Kivity
2007-01-02 17:01 ` Michael Riepe
[not found] ` <459A8FE0.2030202-0QoEqw4nQxo@public.gmane.org>
2007-01-03 8:49 ` Avi Kivity
2007-01-02 17:02 ` Ingo Molnar
[not found] ` <20070102170212.GB25271-X9Un+BFzKDI@public.gmane.org>
2007-01-02 17:09 ` Avi Kivity
2007-01-03 2:22 ` Ingo Molnar
[not found] ` <20070103022241.GA13840-X9Un+BFzKDI@public.gmane.org>
2007-01-03 3:05 ` Anthony Liguori
[not found] ` <459B1D8A.6040604-NZpS4cJIG2HvQtjrzfazuQ@public.gmane.org>
2007-01-03 8:35 ` Avi Kivity
2007-01-03 8:32 ` Avi Kivity
[not found] ` <459B6A15.4010208-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-03 10:02 ` Ingo Molnar
[not found] ` <20070103100235.GA17168-X9Un+BFzKDI@public.gmane.org>
2007-01-03 10:16 ` Avi Kivity [this message]
[not found] ` <459B8267.5080000-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-03 11:30 ` Ingo Molnar
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=459B8267.5080000@qumranet.com \
--to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=mingo-X9Un+BFzKDI@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.