linux-stable/arch/x86/kvm
Wanpeng Li b6c4bc659c KVM: LAPIC: Optimize timer latency further
Advance lapic timer tries to hidden the hypervisor overhead between the
host emulated timer fires and the guest awares the timer is fired. However,
it just hidden the time between apic_timer_fn/handle_preemption_timer ->
wait_lapic_expire, instead of the real position of vmentry which is
mentioned in the orignial commit d0659d946b ("KVM: x86: add option to
advance tscdeadline hrtimer expiration"). There is 700+ cpu cycles between
the end of wait_lapic_expire and before world switch on my haswell desktop.

This patch tries to narrow the last gap(wait_lapic_expire -> world switch),
it takes the real overhead time between apic_timer_fn/handle_preemption_timer
and before world switch into consideration when adaptively tuning timer
advancement. The patch can reduce 40% latency (~1600+ cycles to ~1000+ cycles
on a haswell desktop) for kvm-unit-tests/tscdeadline_latency when testing
busy waits.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Cc: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Liran Alon <liran.alon@oracle.com>
Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-06-04 19:27:30 +02:00
..
vmx KVM: LAPIC: Optimize timer latency further 2019-06-04 19:27:30 +02:00
cpuid.c kvm: x86: Include CPUID leaf 0x8000001e in kvm's supported CPUID 2019-05-24 21:27:06 +02:00
cpuid.h KVM/x86: Update the reverse_cpuid list to include CPUID_7_EDX 2018-02-03 23:06:51 +01:00
debugfs.c KVM: LAPIC: Expose per-vCPU timer_advance_ns to userspace 2019-05-24 21:27:09 +02:00
emulate.c KVM: x86: Always use 32-bit SMRAM save state for 32-bit kernels 2019-04-16 15:37:38 +02:00
hyperv.c * ARM: support for SVE and Pointer Authentication in guests, PMU improvements 2019-05-17 10:33:30 -07:00
hyperv.h x86/kvm/hyper-v: Introduce KVM_GET_SUPPORTED_HV_CPUID 2018-12-14 17:59:54 +01:00
i8254.c kvm: x86: Add memcg accounting to KVM allocations 2019-02-20 22:48:30 +01:00
i8254.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
i8259.c kvm: x86: Add memcg accounting to KVM allocations 2019-02-20 22:48:30 +01:00
ioapic.c kvm: x86: Add memcg accounting to KVM allocations 2019-02-20 22:48:30 +01:00
ioapic.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irq.c kvm: Check irqchip mode before assign irqfd 2019-05-24 21:27:12 +02:00
irq.h kvm: Check irqchip mode before assign irqfd 2019-05-24 21:27:12 +02:00
irq_comm.c KVM: x86: don't hold kvm->lock in KVM_SET_GSI_ROUTING 2017-05-02 14:45:45 +02:00
Kconfig Make anon_inodes unconditional 2019-04-19 14:03:11 +02:00
kvm_cache_regs.h KVM: x86: use direct accessors for RIP and RSP 2019-04-30 22:07:26 +02:00
lapic.c KVM: LAPIC: Optimize timer latency further 2019-06-04 19:27:30 +02:00
lapic.h KVM: LAPIC: Optimize timer latency further 2019-06-04 19:27:30 +02:00
Makefile KVM: x86: fix TRACE_INCLUDE_PATH and remove -I. header search paths 2019-01-25 19:12:37 +01:00
mmu.c kvm: x86: Fix reserved bits related calculation errors caused by MKTME 2019-06-04 19:27:26 +02:00
mmu.h kvm: mmu: Fix overflow on kvm mmu page limit calculation 2019-04-16 15:37:30 +02:00
mmu_audit.c x86/kvm/mmu: make vcpu->mmu a pointer to the current MMU 2018-10-17 00:30:02 +02:00
mmutrace.h KVM: x86: fix handling of role.cr4_pae and rename it to 'gpte_size' 2019-03-28 17:27:03 +01:00
mtrr.c KVM: x86: optimize check for valid PAT value 2019-04-16 15:39:02 +02:00
page_track.c kvm: x86: Add memcg accounting to KVM allocations 2019-02-20 22:48:30 +01:00
paging_tmpl.h * ARM: support for SVE and Pointer Authentication in guests, PMU improvements 2019-05-17 10:33:30 -07:00
pmu.c KVM: x86/pmu: mask the result of rdpmc according to the width of the counters 2019-05-24 21:27:13 +02:00
pmu.h KVM: x86/pmu: mask the result of rdpmc according to the width of the counters 2019-05-24 21:27:13 +02:00
pmu_amd.c KVM: x86/pmu: mask the result of rdpmc according to the width of the counters 2019-05-24 21:27:13 +02:00
svm.c KVM: LAPIC: Optimize timer latency further 2019-06-04 19:27:30 +02:00
trace.h KVM: x86: avoid misreporting level-triggered irqs as edge-triggered in tracing 2019-04-16 15:38:08 +02:00
tss.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
x86.c KVM: LAPIC: Optimize timer latency further 2019-06-04 19:27:30 +02:00
x86.h * ARM: support for SVE and Pointer Authentication in guests, PMU improvements 2019-05-17 10:33:30 -07:00