On 09/02/2009 05:24 AM, Max Laier wrote:
Okay ... I have/something/, but I'm certainly not there yet as I have to admit that I don't understand your idea completely. In addition it seems that EPT doesn't have an accessed bit :-\ Any idea for this?
Use the rwx bits as an approximation. If the pages are needed they'll be faulted back in, which is a lot cheaper than reconstructing them.
But why do you see reclaim with ept? The pages ought to be constructed once and then left alone, unless there is severe memory pressure.
Regardless, testing the attached with EPT, it turns out that not zapping shadow pages with root_count != 0 already makes much difference. After all we don't really zap these pages anyways, but just mark them invalid after zapping the children. So this could be a first improvement. In any case, I clearly don't have the right idea here, yet. Plus I don't really have time to look into this further right now. And my hack is "good enough"[tm] for my testing ... so if anyone more knowledgeable would like to continue - much appreciated. Maybe some of this can at least serve as food for thoughts. Sorry.
Sure.
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index a3f637f..089ad0e 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -394,6 +394,7 @@ struct kvm_arch{ * Hash table of struct kvm_mmu_page. */ struct list_head active_mmu_pages; + struct kvm_mmu_page *scan_hand; struct list_head assigned_dev_head; struct iommu_domain *iommu_domain; int iommu_flags;
Why is a scan hand needed? I though you could just clear the accessed bits and requeue the page.
If you drop a page, all the accessed bits in the ptes are lost with it, so you need to transfer them to the pointed-to pages before you dropped it. Other than that, this seems pretty complete.
-- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html