Go to file
Wanpeng Li d73eb57b80 KVM: Boost vCPUs that are delivering interrupts
Inspired by commit 9cac38dd5d (KVM/s390: Set preempted flag during
vcpu wakeup and interrupt delivery), we want to also boost not just
lock holders but also vCPUs that are delivering interrupts. Most
smp_call_function_many calls are synchronous, so the IPI target vCPUs
are also good yield candidates.  This patch introduces vcpu->ready to
boost vCPUs during wakeup and interrupt delivery time; unlike s390 we do
not reuse vcpu->preempted so that voluntarily preempted vCPUs are taken
into account by kvm_vcpu_on_spin, but vmx_vcpu_pi_put is not affected
(VT-d PI handles voluntary preemption separately, in pi_pre_block).

Testing on 80 HT 2 socket Xeon Skylake server, with 80 vCPUs VM 80GB RAM:
ebizzy -M

            vanilla     boosting    improved
1VM          21443       23520         9%
2VM           2800        8000       180%
3VM           1800        3100        72%

Testing on my Haswell desktop 8 HT, with 8 vCPUs VM 8GB RAM, two VMs,
one running ebizzy -M, the other running 'stress --cpu 2':

w/ boosting + w/o pv sched yield(vanilla)

            vanilla     boosting   improved
              1570         4000      155%

w/ boosting + w/ pv sched yield(vanilla)

            vanilla     boosting   improved
              1844         5157      179%

w/o boosting, perf top in VM:

 72.33%  [kernel]       [k] smp_call_function_many
  4.22%  [kernel]       [k] call_function_i
  3.71%  [kernel]       [k] async_page_fault

w/ boosting, perf top in VM:

 38.43%  [kernel]       [k] smp_call_function_many
  6.31%  [kernel]       [k] async_page_fault
  6.13%  libc-2.23.so   [.] __memcpy_avx_unaligned
  4.88%  [kernel]       [k] call_function_interrupt

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Paul Mackerras <paulus@ozlabs.org>
Cc: Marc Zyngier <maz@kernel.org>
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-07-20 09:00:45 +02:00
arch KVM: Boost vCPUs that are delivering interrupts 2019-07-20 09:00:45 +02:00
block
certs
crypto USB / PHY patches for 5.3-rc1 2019-07-11 15:40:06 -07:00
Documentation f2fs-for-5.3-rc1 2019-07-12 17:28:24 -07:00
drivers Kbuild updates for v5.3 2019-07-12 16:03:16 -07:00
fs dlm for 5.3 2019-07-12 17:37:53 -07:00
include KVM: Boost vCPUs that are delivering interrupts 2019-07-20 09:00:45 +02:00
init Kbuild updates for v5.3 2019-07-12 16:03:16 -07:00
ipc
kernel KVM: LAPIC: Inject timer interrupt via posted interrupt 2019-07-20 09:00:40 +02:00
lib Kbuild updates for v5.3 2019-07-12 16:03:16 -07:00
LICENSES
mm Driver Core and debugfs changes for 5.3-rc1 2019-07-12 12:24:03 -07:00
net 9p pull request for inclusion in 5.13 2019-07-12 17:31:19 -07:00
samples Kbuild updates for v5.3 2019-07-12 16:03:16 -07:00
scripts Kconfig updates for v5.3 2019-07-12 16:06:27 -07:00
security Merge branch 'akpm' (patches from Andrew) 2019-07-12 11:40:28 -07:00
sound Driver Core and debugfs changes for 5.3-rc1 2019-07-12 12:24:03 -07:00
tools KVM: selftests: Remove superfluous define from vmx.c 2019-07-20 09:00:44 +02:00
usr
virt KVM: Boost vCPUs that are delivering interrupts 2019-07-20 09:00:45 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS KVM: s390: add kselftests 2019-07-15 13:28:58 +02:00
Makefile Kbuild updates for v5.3 2019-07-12 16:03:16 -07:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.