• Marcelo Tosatti's avatar
    KVM: MMU: optimize set_spte for page sync · ecc5589f
    Marcelo Tosatti authored
    The write protect verification in set_spte is unnecessary for page sync.
    
    Its guaranteed that, if the unsync spte was writable, the target page
    does not have a write protected shadow (if it had, the spte would have
    been write protected under mmu_lock by rmap_write_protect before).
    
    Same reasoning applies to mark_page_dirty: the gfn has been marked as
    dirty via the pagefault path.
    
    The cost of hash table and memslot lookups are quite significant if the
    workload is pagetable write intensive resulting in increased mmu_lock
    contention.
    Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
    Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
    ecc5589f
mmu.c 70.5 KB