]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: LAPIC: Reduce world switch latency caused by timer_advance_ns
authorWanpeng Li <wanpengli@tencent.com>
Thu, 10 Sep 2020 09:50:41 +0000 (17:50 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 28 Sep 2020 11:57:10 +0000 (07:57 -0400)
commit9d098db301aedee1c440c38e03693af2a9277c6e
treefb912e929c3e402bbd3e73ff706b6b616e4b6d5d
parentc1579ba61acec9d2fdb93d661fa86b39a6068cca
KVM: LAPIC: Reduce world switch latency caused by timer_advance_ns

All the checks in lapic_timer_int_injected(), __kvm_wait_lapic_expire(), and
these function calls waste cpu cycles when the timer mode is not tscdeadline.
We can observe ~1.3% world switch time overhead by kvm-unit-tests/vmexit.flat
vmcall testing on AMD server. This patch reduces the world switch latency
caused by timer_advance_ns feature when the timer mode is not tscdeadline by
simpling move the check against apic->lapic_timer.expired_tscdeadline much
earlier.

Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Message-Id: <1599731444-3525-7-git-send-email-wanpengli@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c
arch/x86/kvm/svm/svm.c
arch/x86/kvm/vmx/vmx.c