public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Christian Borntraeger <borntrae-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: file-backed guest memory
Date: Sat, 14 Apr 2007 17:14:51 +0300	[thread overview]
Message-ID: <4620E1DB.70404@qumranet.com> (raw)
In-Reply-To: <200704130857.15003.borntrae-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>

Christian Borntraeger wrote:
> On Thursday 12 April 2007 17:38, Avi Kivity wrote:
>   
>>> But wouldn't it also be possible to create a file in
>>> userspace and pass its descriptor to kvm?
>>>       
> [...]
>   
>> swap, hugetlbfs, and maybe other nifty stuff.  I think I know how to do 
>> this for the current mmu, but I'm worried that it will have a 
>> performance impact with the nested page tables mmu.
>>     
>
> Another thing to consider is the commit "mm: tracking shared dirty pages" 
> (d08b3851da41d0ee60851f2c75b118e1f7a5fc89). We need a shared mapping to 
> actually have guest memory written back to the file.
> The dirty page tracking change will cause the host kernel to write protect 
> guest memory pages after writeback. This will often trigger guest exits due 
> to host protection faults. If we want to have file backed guest memory we 
> really should modify the VMA to be not eligible for dirty page tracking. 
>   

Actually the Linux mm does not know about the kvm page tables, and thus
cannot do the write protection.  I'm worried that this will confuse it
horribly.

I also think that we should teach the mm how to write protect guest
pages, perhaps less aggressively to account for the large difference in
normal pagefault cost and vmexit pagefault cost.  Hopefully this write
protection is throttled when memory is plentiful to avoid a large
performance hit, regardless of whether it's used for a virtual machine
or normal processes.

-- 
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-14 14:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-12 15:34 file-backed guest memory Michael Riepe
     [not found] ` <461E5181.6010504-0QoEqw4nQxo@public.gmane.org>
2007-04-12 15:38   ` Avi Kivity
     [not found]     ` <461E5286.7090100-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-04-12 15:47       ` Laurent Vivier
     [not found]         ` <461E5497.3090409-6ktuUTfB/bM@public.gmane.org>
2007-04-12 15:56           ` Avi Kivity
2007-04-13  6:57       ` Christian Borntraeger
     [not found]         ` <200704130857.15003.borntrae-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2007-04-14 14:14           ` 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=4620E1DB.70404@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=borntrae-tA70FqPdS9bQT0dZR+AlfA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox