linux/arch/arm/kvm
Marcelo Tosatti ff8bba4038 KVM: use simple waitqueue for vcpu->wq
The problem:

On -RT, an emulated LAPIC timer instances has the following path:

1) hard interrupt
2) ksoftirqd is scheduled
3) ksoftirqd wakes up vcpu thread
4) vcpu thread is scheduled

This extra context switch introduces unnecessary latency in the
LAPIC path for a KVM guest.

The solution:

Allow waking up vcpu thread from hardirq context,
thus avoiding the need for ksoftirqd to be scheduled.

Normal waitqueues make use of spinlocks, which on -RT
are sleepable locks. Therefore, waking up a waitqueue
waiter involves locking a sleeping lock, which
is not allowed from hard interrupt context.

cyclictest command line:

This patch reduces the average latency in my tests from 14us to 11us.

Cc: stable-rt@vger.kernel.org
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2020-10-14 00:59:25 +03:00
..
Kconfig ARM: KVM: Yield CPU when vcpu executes a WFE 2013-10-17 15:26:50 -07:00
Makefile KVM: ARM: Add support for Cortex-A7 2013-10-12 17:45:30 -07:00
arm.c KVM: use simple waitqueue for vcpu->wq 2020-10-14 00:59:25 +03:00
coproc.c KVM: ARM/arm64: avoid returning negative error code as bool 2015-06-29 12:25:38 -07:00
coproc.h ARM: KVM: trap VM system registers until MMU and caches are ON 2015-05-17 09:53:52 -07:00
coproc_a7.c ARM: KVM: trap VM system registers until MMU and caches are ON 2015-05-17 09:53:52 -07:00
coproc_a15.c ARM: KVM: trap VM system registers until MMU and caches are ON 2015-05-17 09:53:52 -07:00
emulate.c KVM: ARM: Fix typo in comments of inject_abt() 2013-10-02 17:29:19 +01:00
guest.c ARM: KVM: introduce per-vcpu HYP Configuration Register 2015-05-17 09:53:52 -07:00
handle_exit.c arm/arm64: KVM: Complete WFI/WFE instructions 2014-10-05 14:52:10 -07:00
init.S ARM/ARM64: KVM: Nuke Hyp-mode tlbs before enabling MMU 2014-10-05 14:52:10 -07:00
interrupts.S arm/arm64: KVM: detect CPU reset on CPU_PM_EXIT 2014-02-27 19:27:10 +01:00
interrupts_head.S ARM: KVM: add world-switch for AMAIR{0,1} 2015-05-17 09:53:52 -07:00
mmio.c arm/arm64: KVM: MMIO support for BE guest 2013-11-07 19:09:04 +00:00
mmu.c ARM: KVM: user_mem_abort: support stage 2 MMIO page mapping 2015-06-29 12:25:37 -07:00
perf.c ARM: KVM: add support for minimal host vs guest profiling 2013-04-28 21:44:01 -07:00
psci.c KVM: use simple waitqueue for vcpu->wq 2020-10-14 00:59:25 +03:00
reset.c Updates for KVM/ARM, take 3 supporting more than 4 CPUs. 2013-11-11 12:02:27 +01:00
trace.h ARM: KVM: Simplify tracepoint text 2013-08-30 15:47:53 -07:00