KVM: LAPIC: Narrow the timer latency between wait_lapic_expire and world switch
authorWanpeng Li <wanpengli@tencent.com>
Tue, 18 May 2021 12:00:35 +0000 (05:00 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 27 May 2021 11:45:58 +0000 (07:45 -0400)
commit9805cf03fdb6828091fe09e4ef0fb544fca3eaf6
treea51918d68d2f6c189ac24c3a1d6bf4787c5b5880
parentfb0f94794bb7558c078ce37b1a6e30d881fd7888
KVM: LAPIC: Narrow the timer latency between wait_lapic_expire and world switch

Let's treat lapic_timer_advance_ns automatic tuning logic as hypervisor
overhead, move it before wait_lapic_expire instead of between wait_lapic_expire
and the world switch, the wait duration should be calculated by the
up-to-date guest_tsc after the overhead of automatic tuning logic. This
patch reduces ~30+ cycles for kvm-unit-tests/tscdeadline-latency when testing
busy waits.

Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Message-Id: <1621339235-11131-5-git-send-email-wanpengli@tencent.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c