* Need info on guest swapping and other things in KVM @ 2008-04-05 0:18 Arjun 2008-04-06 7:39 ` Avi Kivity 0 siblings, 1 reply; 4+ messages in thread From: Arjun @ 2008-04-05 0:18 UTC (permalink / raw) To: kvm-devel [-- Attachment #1.1: Type: text/plain, Size: 784 bytes --] Hi Folks, A fellow student and I wish to do run some experiments with KVM. Specifically, we would like to examine KVM's guest paging/swapping mechanism, make some changes and run some tests. After a brief search through the docs and code, we would greatly appreciate help with the following: 1) Guest Paging : What is the selection mechanism used by KVM for evicting a guest's page ? What if there are any conflicts between host and guest as to which page to evict ? 2) Where can we find the code for the above (guest paging). 3) Are the KVM guests scheduled by the (hosts) standard linux scheduler ? It appears that this is the case but I want to be sure. 4) Have there been any changes to the host's page/buffer cache ? Are there any changes planned ? Thanks in advance Arjun [-- Attachment #1.2: Type: text/html, Size: 858 bytes --] [-- Attachment #2: Type: text/plain, Size: 325 bytes --] ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone [-- Attachment #3: Type: text/plain, Size: 158 bytes --] _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Need info on guest swapping and other things in KVM 2008-04-05 0:18 Need info on guest swapping and other things in KVM Arjun @ 2008-04-06 7:39 ` Avi Kivity 2008-04-07 0:30 ` Arjun 0 siblings, 1 reply; 4+ messages in thread From: Avi Kivity @ 2008-04-06 7:39 UTC (permalink / raw) To: Arjun; +Cc: kvm-devel Arjun wrote: > Hi Folks, > > A fellow student and I wish to do run some experiments with KVM. > Specifically, we would like to examine > KVM's guest paging/swapping mechanism, make some changes and run some > tests. After a brief search through > the docs and code, we would greatly appreciate help with the following: > > 1) Guest Paging : What is the selection mechanism used by KVM for > evicting a guest's page ? With mmu notifiers (not yet merged), pages are picked by the normal Linux LRU mechanism. > What if there are any conflicts between host and guest as to which > page to evict ? > I don't understand this question. > 2) Where can we find the code for the above (guest paging). It's the normal Linux swapping code. > > 3) Are the KVM guests scheduled by the (hosts) standard linux > scheduler ? It appears that this > is the case but I want to be sure. Yes. > > 4) Have there been any changes to the host's page/buffer cache ? Are > there any changes planned ? > Yes, mmu notifiers. This doesn't change pagecache, but rather allows kvm's shadow mmu to be synchronized to the main Linux mmu, which is what allows page eviction and page aging to work. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Need info on guest swapping and other things in KVM 2008-04-06 7:39 ` Avi Kivity @ 2008-04-07 0:30 ` Arjun 2008-04-07 4:08 ` Avi Kivity 0 siblings, 1 reply; 4+ messages in thread From: Arjun @ 2008-04-07 0:30 UTC (permalink / raw) To: kvm-devel, Avi Kivity [-- Attachment #1.1: Type: text/plain, Size: 2324 bytes --] Avi, Thanks for your response. Regarding the query on "Guest Swapping", I'm referring to the mechanism that the KVM host can use to swap out a guest's pages. Since a guest OS will have its own swapping mechanism, then how will the host ensure that if it choses to swap out a guest's page, it will not conflict with the guest's own swapping mechanism. Put another way: I understand (from docs, mailing list etc.) that KVM allows the host to overbook/overcommit physical memory via the guest swapping mechanism. i.e. the guest thinks it has x number of physical pages but actually the host has swapped out some of the guests pages and given the freed up physical memory to another guest VM. So the guest actually has less than x pages in physical memory but doesn't know it. It possible that my understanding of the way KVM works may be incorrect, in that case any clarifications would be appreciated. Thanks again Arjun On Sun, Apr 6, 2008 at 3:39 AM, Avi Kivity <avi@qumranet.com> wrote: > Arjun wrote: > > > Hi Folks, > > > > A fellow student and I wish to do run some experiments with KVM. > > Specifically, we would like to examine > > KVM's guest paging/swapping mechanism, make some changes and run some > > tests. After a brief search through > > the docs and code, we would greatly appreciate help with the following: > > > > 1) Guest Paging : What is the selection mechanism used by KVM for > > evicting a guest's page ? > > > > With mmu notifiers (not yet merged), pages are picked by the normal Linux > LRU mechanism. > > What if there are any conflicts between host and guest as to which page > > to evict ? > > > > > I don't understand this question. > > 2) Where can we find the code for the above (guest paging). > > > > It's the normal Linux swapping code. > > > > 3) Are the KVM guests scheduled by the (hosts) standard linux scheduler > > ? It appears that this > > is the case but I want to be sure. > > > > Yes. > > > > 4) Have there been any changes to the host's page/buffer cache ? Are > > there any changes planned ? > > > > > Yes, mmu notifiers. This doesn't change pagecache, but rather allows > kvm's shadow mmu to be synchronized to the main Linux mmu, which is what > allows page eviction and page aging to work. > > -- > error compiling committee.c: too many arguments to function > > [-- Attachment #1.2: Type: text/html, Size: 3410 bytes --] [-- Attachment #2: Type: text/plain, Size: 325 bytes --] ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone [-- Attachment #3: Type: text/plain, Size: 158 bytes --] _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Need info on guest swapping and other things in KVM 2008-04-07 0:30 ` Arjun @ 2008-04-07 4:08 ` Avi Kivity 0 siblings, 0 replies; 4+ messages in thread From: Avi Kivity @ 2008-04-07 4:08 UTC (permalink / raw) To: Arjun; +Cc: kvm-devel Please don't top-post. Arjun wrote: > Avi, > Thanks for your response. > > Regarding the query on "Guest Swapping", I'm referring to the > mechanism that the KVM host can use to swap out a guest's pages. Since > a guest OS will have its own swapping mechanism, then how will the > host ensure that if it choses to swap out a guest's page, it will not > conflict with the guest's own swapping mechanism. > Put another way: I understand (from docs, mailing list etc.) that KVM > allows the host to overbook/overcommit physical memory via the guest > swapping mechanism. i.e. the guest thinks it has x number of physical > pages but actually the host has swapped out some of the guests pages > and given the freed up physical memory to another guest VM. So the > guest actually has less than x pages in physical memory but doesn't > know it. > The guest and host swapping algorithms are completely independent. It is quite possible for the host to select an incorrect page (from a performance point of view) for swapping. There is a proposal (search for "CMM2") to allow cooperation between guest and host in this area. -- Any sufficiently difficult bug is indistinguishable from a feature. ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-04-07 4:08 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-04-05 0:18 Need info on guest swapping and other things in KVM Arjun 2008-04-06 7:39 ` Avi Kivity 2008-04-07 0:30 ` Arjun 2008-04-07 4:08 ` Avi Kivity
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox