KVM: MMU: improve write flooding detected
Detecting write-flooding does not work well, when we handle page written, if the last speculative spte is not accessed, we treat the page is write-flooding, however, we can speculative spte on many path, such as pte prefetch, page synced, that means the last speculative spte may be not point to the written page and the written page can be accessed via other sptes, so depends on the Accessed bit of the last speculative spte is not enough Instead of detected page accessed, we can detect whether the spte is accessed after it is written, if the spte is not accessed but it is written frequently, we treat is not a page table or it not used for a long time Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:

committed by
Avi Kivity

parent
5d9ca30e96
commit
a30f47cb15
@@ -239,6 +239,8 @@ struct kvm_mmu_page {
|
||||
int clear_spte_count;
|
||||
#endif
|
||||
|
||||
int write_flooding_count;
|
||||
|
||||
struct rcu_head rcu;
|
||||
};
|
||||
|
||||
@@ -353,10 +355,6 @@ struct kvm_vcpu_arch {
|
||||
struct kvm_mmu_memory_cache mmu_page_cache;
|
||||
struct kvm_mmu_memory_cache mmu_page_header_cache;
|
||||
|
||||
gfn_t last_pt_write_gfn;
|
||||
int last_pt_write_count;
|
||||
u64 *last_pte_updated;
|
||||
|
||||
struct fpu guest_fpu;
|
||||
u64 xcr0;
|
||||
|
||||
|
Reference in New Issue
Block a user