The short answer is that I am still see large system time hiccups in the guests due to kscand in the guest scanning its active lists. I do see better response for a KVM_MAX_PTE_HISTORY of 3 than with 4. (For completeness I also tried a history of 2, but it performed worse than 3 which is no surprise given the meaning of it.) I have been able to scratch out a simplistic program that stimulates kscand activity similar to what is going on in my real guest (see attached). The program requests a memory allocation, initializes it (to get it backed) and then in a loop sweeps through the memory in chunks similar to a program using parts of its memory here and there but eventually accessing all of it. Start the RHEL3/CentOS 3 guest with *2GB* of RAM (or more). The key is using a fair amount of highmem. Start a couple of instances of the attached. For example, I've been using these 2: memuser 768M 120 5 300 memuser 384M 300 10 600 Together these instances take up a 1GB of RAM and once initialized consume very little CPU. On kvm they make kscand and kswapd go nuts every 5-15 minutes. For comparison, I do not see the same behavior for an identical setup running on esx 3.5. david Avi Kivity wrote: > Avi Kivity wrote: >> >> There are (at least) three options available: >> - detect and special-case this scenario >> - change the flood detector to be per page table instead of per vcpu >> - change the flood detector to look at a list of recently used page >> tables instead of the last page table >> >> I'm having a hard time trying to pick between the second and third >> options. >> > > The answer turns out to be "yes", so here's a patch that adds a pte > access history table for each shadowed guest page-table. Let me know if > it helps. Benchmarking a variety of workloads on all guests supported > by kvm is left as an exercise for the reader, but I suspect the patch > will either improve things all around, or can be modified to do so. >