All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] KVM: optimize userspace exits with a new ioctl
@ 2015-08-05 13:21 Radim Krčmář
  2015-08-05 13:21 ` [PATCH 1/5] KVM: add kvm_has_request wrapper Radim Krčmář
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Radim Krčmář @ 2015-08-05 13:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: kvm, Paolo Bonzini

QEMU uses SIGUSR1 to force a userspace exit and also to queue an early
exit before calling VCPU_RUN -- the signal is blocked in user space and
temporarily unblocked in VCPU_RUN.
The temporal unblocking by sigprocmask() in kvm_arch_vcpu_ioctl_run()
takes a shared siglock, which leads to cacheline bouncing in NUMA
systems.

This series allows the same with a new request bit and VM IOCTL that
marks and kicks target VCPU, hence no need to unblock.

inl_from_{pmtimer,qemu} vmexit benchmark from kvm-unit-tests shows ~5%
speedup for 1-4 VCPUs (300-2000 saved cycles) without noticeably
regressing kernel VM exits.
(Paolo did a quick run of older version of this series on a NUMA system
 and the speedup was around 35% when utilizing more nodes.)


Radim Krčmář (5):
  KVM: add kvm_has_request wrapper
  KVM: add KVM_REQ_EXIT request for userspace exit
  KVM: add KVM_USER_EXIT vm ioctl for userspace exit
  KVM: optimize common cases in KVM_USER_EXIT
  KVM: x86: add request_exits debug counter

 Documentation/virtual/kvm/api.txt | 30 ++++++++++++++++++++++++++++
 arch/x86/include/asm/kvm_host.h   |  1 +
 arch/x86/kvm/vmx.c                |  4 ++--
 arch/x86/kvm/x86.c                |  9 +++++++++
 include/linux/kvm_host.h          | 15 ++++++++++++--
 include/uapi/linux/kvm.h          |  9 +++++++++
 virt/kvm/kvm_main.c               | 41 ++++++++++++++++++++++++++++++++++++++-
 7 files changed, 104 insertions(+), 5 deletions(-)

-- 
2.5.0

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-08-05 13:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-05 13:21 [PATCH 0/5] KVM: optimize userspace exits with a new ioctl Radim Krčmář
2015-08-05 13:21 ` [PATCH 1/5] KVM: add kvm_has_request wrapper Radim Krčmář
2015-08-05 13:21 ` [PATCH 2/5] KVM: add KVM_REQ_EXIT request for userspace exit Radim Krčmář
2015-08-05 13:21 ` [PATCH 3/5] KVM: add KVM_USER_EXIT vm ioctl " Radim Krčmář
2015-08-05 13:29   ` Paolo Bonzini
2015-08-05 13:34     ` Radim Krčmář
2015-08-05 13:38       ` Paolo Bonzini
2015-08-05 13:48         ` Radim Krčmář
2015-08-05 13:21 ` [PATCH 4/5] KVM: optimize common cases in KVM_USER_EXIT Radim Krčmář
2015-08-05 13:21 ` [PATCH 5/5] KVM: x86: add request_exits debug counter Radim Krčmář

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.