On Wed, 2008-07-02 at 02:11 -0400, Arn wrote: > Hi KVM devs, > > I'm trying to write a guest kernel module (or modify kernel code) to > do the following : > > Say I have a kvm guest with 512 MB RAM running on a host with 2 GB > RAM. Now I run a process on the host that will cause increasing memory > pressure which will in turn cause the host to swap out some of the > guests pages (without the guest knowing). My guest kernel module will > randomly access some of its physical pages (say read a byte from a > page) and time the accesses. > > In theory an attempt by the guest to access a page that has been > swapped out by the host should take much longer than accessing a page > that is in memory.
Your assumption is correct for userspace allocation inside the guest. Let me explain: The current kvm without mmu-notifiers, can transparently swap guest pages only if they are not pointed by the shadow page tables. One a spte is instantiated the page cannot go to swap. mmu notifiers will cancel this limitation and we'll get notifications about page swapping from the host MM. IIRC guest kernel allocations has the global bit set, thus we optimize the shadow mmu not to flush global guest pages, so if this assumption is correct, you won't feel the difference. Anyway what's your motivation for this module? > > Since I'm still a novice can someone advise/guide me on this and let > me know if I'm missing something crucial in my assumptions ? I'm using > an amd64 machine with host/guest kernel 2.6.22 and kvm-64 > > Thanks in advance > a. rn > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
