public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Nai Xia <nai.xia@gmail.com>
To: Prateek Sharma <prateek3.14@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: Dirty page tracking in EPT
Date: Mon, 3 Oct 2011 11:34:32 +0800	[thread overview]
Message-ID: <201110031134.32890.nai.xia@gmail.com> (raw)
In-Reply-To: <CAKwxwqz3GKjQzsZW1rOQeyQaJvSnx8ytnfDEeHR13rwUqRHZoA@mail.gmail.com>

Hi, 

On Sunday 02 October 2011 17:43:23 Prateek Sharma wrote:
> Hello ,
>     I came across the dirty-page tracking patch here:
> [https://lkml.org/lkml/2011/6/21/169] .
> There is some mention of dirty-bit tracking not working with EPT. Can
> someone please clarify this? Does this patch only work when using
> software shadow page tables ?

When ksm is scanning the memory, it is working on the host virutal
addresses, so this patch tries to figure out if the page pointed to by
the pte is actually dirty in the guests through the scanning of sptes.
But, Intel EPT does not update the dirty bit (and other similar bits)
in sptes, so for Intel EPT we fall back to checksum based approach
in the patch.

This patch should work on AMD RVI/NPT although I hadn't the hardware
to test it yet. And also, my v2 patch considers huge page as a whole, and
try to skip it if any of the subpage is dirty, and I am still trying to 
quantify the cost balance between breaking up active huge pages and 
potential swapping. So maybe sometime I will give out a v3 patch totally
disabling the huge page consideration. 

> 
>    On a related note (i've asked a related question on this list a
> couple of days back), why can we not use the
> kvm_vm_ioctl_get_dirty_log function

While I am not an expert in kvm, I don't think kvm_vm_ioctl_get_dirty_log()
or kvm_memory_slot->dirty_bitmap can catch the normal writes issued from inside
guest OS. Maybe some experts in this list can help you understand the code ;-)

Thanks,

Nai


> [http://lxr.linux.no/#linux+v3.0/arch/x86/kvm/x86.c#L3297] ?  Is it
> because it is too expensive? If yes, can we use the dirty-page
> tracking ideas in this patch and use it for the migration code?
> 
> 
> Thanks for reading,
> Prateek
> 

  reply	other threads:[~2011-10-03  3:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-02  9:43 Dirty page tracking in EPT Prateek Sharma
2011-10-03  3:34 ` Nai Xia [this message]
2011-10-03  4:17   ` Prateek Sharma

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=201110031134.32890.nai.xia@gmail.com \
    --to=nai.xia@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=prateek3.14@gmail.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