Re: [kvm-devel] [RFC]kvm: swapout guest page

2007-05-22 Thread Carsten Otte
Avi Kivity wrote: Ooh, I want one too. You can get one here: http://www-03.ibm.com/systems/z/os/linux/lcds/ This might get useful the day we merge our stuff into kvm. so long, Carsten - This SF.net email is sponsored by DB2

[kvm-devel] [RFC]kvm: swapout guest page

2007-05-21 Thread Shaohua Li
Hi, I saw some discussions on the topic but no progress. I did an experiment to make guest page be allocated dynamically and swap out. please see attachment patches. It's not yet for merge but I'd like get some suggestions and help. Patches (against kvm-19) work here but maybe not very stable as

Re: [kvm-devel] [RFC]kvm: swapout guest page

2007-05-21 Thread Dor Laor
Hi, I saw some discussions on the topic but no progress. I did an experiment to make guest page be allocated dynamically and swap out. Wow, that's a very nice/welcomed/hard experience. please see attachment patches. It's not yet for merge but I'd like get some suggestions and help. Patches

Re: [kvm-devel] [RFC]kvm: swapout guest page

2007-05-21 Thread Carsten Otte
Shaohua Li wrote: +EXPORT_SYMBOL(delete_from_swap_cache); +EXPORT_SYMBOL(move_to_swap_cache); +EXPORT_SYMBOL(lookup_swap_cache); +EXPORT_SYMBOL(read_swap_cache_async); +EXPORT_SYMBOL(get_swap_page); +EXPORT_SYMBOL(swap_free); +EXPORT_SYMBOL(add_to_page_cache_lru); Use EXPORT_SYMBOL_GPL for

Re: [kvm-devel] [RFC]kvm: swapout guest page

2007-05-21 Thread Avi Kivity
Shaohua Li wrote: Hi, I saw some discussions on the topic but no progress. I did an experiment to make guest page be allocated dynamically and swap out. please see attachment patches. It's not yet for merge but I'd like get some suggestions and help. Patches (against kvm-19) work here but

Re: [kvm-devel] [RFC]kvm: swapout guest page

2007-05-21 Thread Christoph Hellwig
On Mon, May 21, 2007 at 11:17:06AM +0200, Carsten Otte wrote: Shaohua Li wrote: +EXPORT_SYMBOL(delete_from_swap_cache); +EXPORT_SYMBOL(move_to_swap_cache); +EXPORT_SYMBOL(lookup_swap_cache); +EXPORT_SYMBOL(read_swap_cache_async); +EXPORT_SYMBOL(get_swap_page);

Re: [kvm-devel] [RFC]kvm: swapout guest page

2007-05-21 Thread Carsten Otte
Avi Kivity wrote: For one thing, kvm uses page-private to store its rmap information. This is lost if regular mappings are used. More importantly, both the regular address space and kvm will want to be called when a page is paged out, while this is doable, it isn't easy. Taking the long

Re: [kvm-devel] [RFC]kvm: swapout guest page

2007-05-21 Thread Avi Kivity
Carsten Otte wrote: Avi Kivity wrote: For one thing, kvm uses page-private to store its rmap information. This is lost if regular mappings are used. More importantly, both the regular address space and kvm will want to be called when a page is paged out, while this is doable, it isn't

Re: [kvm-devel] [RFC]kvm: swapout guest page

2007-05-21 Thread Carsten Otte
Avi Kivity wrote: The pte is stored/cached in two different places (in addition to what Linux already knows about): - in the shadow page tables - in the tlbs of the vcpus that may have referenced the page so, when swapping out the page, you need to use the kvm rmap to find all shadow

Re: [kvm-devel] [RFC]kvm: swapout guest page

2007-05-21 Thread Avi Kivity
Carsten Otte wrote: An example: suppose host pfn 7 is allocated as guest pfn 8 (and therefore, userspace address 0x8000). Suppose further the guest maps guest pfn 8 to guest virtual 0x1 and guest virtal 0x11000. Aren't there three tlbs you need to shoot down? host virtual

Re: [kvm-devel] [RFC]kvm: swapout guest page

2007-05-21 Thread Avi Kivity
Carsten Otte wrote: Avi Kivity wrote: Interesting. And if you have multiple guest virtual to guest physical translations, the hardware knows to flush them when the host virtual to host physical entry is flushed? Yes, the cpu flushes all of them. Ooh, I want one too. -- error compiling

Re: [kvm-devel] [RFC]kvm: swapout guest page

2007-05-21 Thread Carsten Otte
Avi Kivity wrote: Interesting. And if you have multiple guest virtual to guest physical translations, the hardware knows to flush them when the host virtual to host physical entry is flushed? Yes, the cpu flushes all of them. so long, Carsten