diff options
author | Sean Christopherson <seanjc@google.com> | 2021-08-12 11:14:14 -0700 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-08-13 03:31:56 -0400 |
commit | 0103098fb4f13b447b26ed514bcd3140f6791047 (patch) | |
tree | 3f04455b6e6080e4bb03c8d9a8ef84a1033890b1 /Documentation | |
parent | 524a1e4e381fc5e7781008d5bd420fd1357c0113 (diff) |
KVM: x86/mmu: Don't step down in the TDP iterator when zapping all SPTEs
Set the min_level for the TDP iterator at the root level when zapping all
SPTEs to optimize the iterator's try_step_down(). Zapping a non-leaf
SPTE will recursively zap all its children, thus there is no need for the
iterator to attempt to step down. This avoids rereading the top-level
SPTEs after they are zapped by causing try_step_down() to short-circuit.
In most cases, optimizing try_step_down() will be in the noise as the cost
of zapping SPTEs completely dominates the overall time. The optimization
is however helpful if the zap occurs with relatively few SPTEs, e.g. if KVM
is zapping in response to multiple memslot updates when userspace is adding
and removing read-only memslots for option ROMs. In that case, the task
doing the zapping likely isn't a vCPU thread, but it still holds mmu_lock
for read and thus can be a noisy neighbor of sorts.
Reviewed-by: Ben Gardon <bgardon@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210812181414.3376143-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions