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