All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: "Dong, Eddie" <eddie.dong-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel <kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: Re: #PF & shadow
Date: Sat, 28 Apr 2007 09:06:42 +0300	[thread overview]
Message-ID: <4632E472.20005@qumranet.com> (raw)
In-Reply-To: <10EA09EFD8728347A513008B6B0DA77A014E8AA1-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>

Dong, Eddie wrote:
> 	I am looking into the efficiency of shadow code and get
> interesting sight: Increasing KVM_NUM_MMU_PAGES doesn't help performance
> which is quit stranger, and the #PF is realitively higher than other
> virtualization solution.
> 	If any of you have any sight, please let me know.
> thanks, eddie
>   

I know of the following issues in the mmu; of course there are likely more:

1. eviction is based on a FIFO policy instead of an approximation of an
LRU.
2. the heuristics of when to unshadow a page (kvm_mmu_pre_write) have
not been tuned.  This can have two effects:
     - a page is unshadowed prematurely, causing many shadow faults later on
     - a page is not unshadowed soon enough, causing too many emulations
(a page should be unshadowed if the guest page is no longer a page
table, or if it is batch updated as in fork())
3. when we emulate a write, we zero out the shadow entry, but we could
instead translate the guest pte and install it in the shadow page. 
That's the purpose of kvm_mmu_post_post_write() which is currently
empty.  This could reduce the cost of a guest minor fault from three
vmexits to two (one for the guest fault, one for the pte update).  I
started implementing this but got distracted.
4. not strictly mmu: after an mmio read, we re-enter the guest and get a
vmexit directly.  Instead we should enter the emulator immediately after
an mmio read.  I implemented that
(b0092d187cfa19dfcada3b85d728af5ae27989dc), but backed it out soon after
due to a regression it introduced with nonpae guests.  I'll look into
redoing it.



-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

  parent reply	other threads:[~2007-04-28  6:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-27 13:24 [ANNOUNCE] kvm-21 release Avi Kivity
     [not found] ` <4631F988.4040306-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-04-27 15:13   ` #PF & shadow Dong, Eddie
     [not found]     ` <10EA09EFD8728347A513008B6B0DA77A014E8AA1-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-04-28  6:06       ` Avi Kivity [this message]
     [not found]         ` <4632E472.20005-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-04-29 11:03           ` Avi Kivity

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=4632E472.20005@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=eddie.dong-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@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.