From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Chen Haogang <haogangchen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: Swapping out kvm pages
Date: Sun, 15 Apr 2007 20:13:36 +0300 [thread overview]
Message-ID: <46225D40.2020400@qumranet.com> (raw)
In-Reply-To: <c4ebe0280704142300x379fb7b8u2a8df7101292b414-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Chen Haogang wrote:
> I encountered another problem. Because guest uses its own PTEs, host
> cannot track page usage of the guest, including dirty flag in guest
> PTEs. So host will consider those pages clean and reclaim them without
> writing back.
>
> What I currently think to walk around this is set the PG_dirty flag
> manually, but this involves tracking every guest write, and may
> introduce heavy overhead. I wonder if kvm & qemu already have such
> machanism and how about its overhead?
>
You don't need to track writes, only transitions of pte writable bits to
1. These occur much more rarely than writes, and are quite easy to trap.
More difficult is the reverse operation: before the host cleans a page,
it must make it read-only for the guest. It's doable but complex,
especially as the writeout operation and the guest may execute concurrently.
> I also found many pages used by guest will be referenced by host. But
> I don't know whether EVERY active guest pages will be mapped to host's
> qemu. Do you know when and how will the host make references to those
> guest pages?
>
I expect most are due to dma by the network card and the disk
controller. Also, operations like live migration will touch every page.
--
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/
prev parent reply other threads:[~2007-04-15 17:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-11 13:34 Swapping out kvm pages Chen Haogang
[not found] ` <c4ebe0280704110634h19ddc60egbff264b8e3dbc503-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-04-11 14:41 ` Avi Kivity
2007-04-15 6:00 ` Chen Haogang
[not found] ` <c4ebe0280704142300x379fb7b8u2a8df7101292b414-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-04-15 17:13 ` 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=46225D40.2020400@qumranet.com \
--to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
--cc=haogangchen-Re5JQEeQqe8AvxtiuMwx3w@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