提交 fcd6dbac 编写于 作者: A Avi Kivity

KVM: MMU: Only mark_page_accessed() if the page was accessed by the guest

If the accessed bit is not set, the guest has never accessed this page
(at least through this spte), so there's no need to mark the page
accessed.  This provides more accurate data for the eviction algortithm.

Noted by Andrea Arcangeli.
Signed-off-by: NAvi Kivity <avi@qumranet.com>
上级 d39f13b0
...@@ -549,7 +549,8 @@ static void rmap_remove(struct kvm *kvm, u64 *spte) ...@@ -549,7 +549,8 @@ static void rmap_remove(struct kvm *kvm, u64 *spte)
return; return;
sp = page_header(__pa(spte)); sp = page_header(__pa(spte));
page = spte_to_page(*spte); page = spte_to_page(*spte);
mark_page_accessed(page); if (*spte & PT_ACCESSED_MASK)
mark_page_accessed(page);
if (is_writeble_pte(*spte)) if (is_writeble_pte(*spte))
kvm_release_page_dirty(page); kvm_release_page_dirty(page);
else else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册