• Rik van Riel's avatar
    KVM: VMX: emulate accessed bit for EPT · 6316e1c8
    Rik van Riel authored
    Currently KVM pretends that pages with EPT mappings never got
    accessed.  This has some side effects in the VM, like swapping
    out actively used guest pages and needlessly breaking up actively
    used hugepages.
    
    We can avoid those very costly side effects by emulating the
    accessed bit for EPT PTEs, which should only be slightly costly
    because pages pass through page_referenced infrequently.
    
    TLB flushing is taken care of by kvm_mmu_notifier_clear_flush_young().
    
    This seems to help prevent KVM guests from being swapped out when
    they should not on my system.
    Signed-off-by: default avatarRik van Riel <riel@redhat.com>
    Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
    6316e1c8
mmu.c 80.8 KB