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?

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?


2007/4/11, Chen Haogang <[EMAIL PROTECTED]>:
>
>
> In kvm's TODO page, I saw the item "attach kvm memory to a Linux 
> address_space so that guest memory can be paged out". But I don't think it is 
> as simple as this. Because both host part page fault and guest part page 
> fault interact.
>
> As I know, the creation of guest's shadow PTEs don't go through host's PTEs. 
> When a shadow PTE is to be created, it always assumes the page pointer stored 
> in memory region is vaild, and use the page struct to calcuate host physical 
> address.
>
> So, if we want to implement a swap mechanism. It is important to mark the 
> page struct pointer as invalid when host frame is swapped out. And replace 
> the page pointer with the new one when a frame is swapped in.
>
> Moreover, we should not swapped out pages that are currently mapped by shadow 
> PTEs unless we got a way to invalidate them. On the guest part, when a shadow 
> PTE is to be created, we should make sure the page pointer in memory regeion 
> is vaild ( i.e. the page is not swapped out), if not, we should ask to host 
> to bring in the page before guest can resume.
>
> I want to know if I misunderstood anything, and wonder if there's any easier 
> way to implement guest pages' swapping?
>
>



-- 
Best regards,
Chen Haogang

-------------------------------------------------------------------------
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/
_______________________________________________
kvm-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to