kernel_optimize_test/virt/kvm/arm
Davidlohr Bueso da4ad88cab kvm: Replace vcpu->swait with rcuwait
The use of any sort of waitqueue (simple or regular) for
wait/waking vcpus has always been an overkill and semantically
wrong. Because this is per-vcpu (which is blocked) there is
only ever a single waiting vcpu, thus no need for any sort of
queue.

As such, make use of the rcuwait primitive, with the following
considerations:

  - rcuwait already provides the proper barriers that serialize
  concurrent waiter and waker.

  - Task wakeup is done in rcu read critical region, with a
  stable task pointer.

  - Because there is no concurrency among waiters, we need
  not worry about rcuwait_wait_event() calls corrupting
  the wait->task. As a consequence, this saves the locking
  done in swait when modifying the queue. This also applies
  to per-vcore wait for powerpc kvm-hv.

The x86 tscdeadline_latency test mentioned in 8577370fb0
("KVM: Use simple waitqueue for vcpu->wq") shows that, on avg,
latency is reduced by around 15-20% with this change.

Cc: Paul Mackerras <paulus@ozlabs.org>
Cc: kvmarm@lists.cs.columbia.edu
Cc: linux-mips@vger.kernel.org
Reviewed-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Message-Id: <20200424054837.5138-6-dave@stgolabs.net>
[Avoid extra logic changes. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-05-13 12:14:56 -04:00
..
hyp KVM: arm64: Fix 32bit PC wrap-around 2020-05-01 09:51:08 +01:00
vgic KVM: arm64: vgic-v4: Initialize GICv4.1 even in the absence of a virtual ITS 2020-04-30 12:50:23 +01:00
aarch32.c KVM: arm: Make inject_abt32() inject an external abort instead 2020-01-23 10:38:15 +00:00
arch_timer.c kvm: Replace vcpu->swait with rcuwait 2020-05-13 12:14:56 -04:00
arm.c kvm: Replace vcpu->swait with rcuwait 2020-05-13 12:14:56 -04:00
hypercalls.c
mmio.c KVM: arm/arm64: Cleanup MMIO handling 2020-01-23 10:38:14 +00:00
mmu.c KVM: Terminate memslot walks via used_slots 2020-03-16 17:57:26 +01:00
perf.c KVM: Move running VCPU from ARM to common code 2020-01-27 19:59:54 +01:00
pmu.c KVM: arm64: pmu: Only handle supported event counters 2020-01-28 13:05:05 +00:00
psci.c KVM: arm64: PSCI: Forbid 64bit functions for 32bit guests 2020-04-17 09:51:45 +01:00
pvtime.c
trace.h KVM: arm/arm64: Fix up includes for trace.h 2020-02-05 14:26:16 +00:00