linux/arch/s390
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
..
appldata sched: loadavg: consolidate LOAD_INT, LOAD_FRAC, CALC_LOAD 2018-10-26 16:26:32 -07:00
boot s390/boot: fix compiler error due to missing awk strtonum 2019-05-07 14:37:14 +02:00
configs Kbuild updates for v5.3 2019-07-12 16:03:16 -07:00
crypto s390/crypto: sha: Use -ENODEV instead of -EOPNOTSUPP 2019-06-15 12:24:48 +02:00
hypfs s390/kernel: introduce .dma sections 2019-04-29 10:47:10 +02:00
include s390 updates for the 5.3 merge window #2 2019-07-12 15:39:22 -07:00
kernel s390 updates for the 5.3 merge window #2 2019-07-12 15:39:22 -07:00
kvm KVM: Boost vCPUs that are delivering interrupts 2019-07-20 09:00:45 +02:00
lib s390: enforce CONFIG_SMP 2019-06-07 10:09:37 +02:00
mm Merge branch 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2019-07-08 21:48:15 -07:00
net s390: bpf: eliminate zero extension code-gen 2019-05-24 18:58:38 -07:00
numa treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
oprofile s390/unwind: introduce stack unwind API 2019-05-02 13:54:11 +02:00
pci s390 updates for the 5.3 merge window #2 2019-07-12 15:39:22 -07:00
purgatory s390/purgatory: update .gitignore 2019-06-04 15:03:42 +02:00
scripts s390: make chkbss work with clang 2019-04-11 13:36:52 +02:00
tools s390/disassembler: update opcode table 2019-06-04 15:03:58 +02:00
Kbuild
Kconfig mm: rename CONFIG_HAVE_GENERIC_GUP to CONFIG_HAVE_FAST_GUP 2019-07-12 11:05:44 -07:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Makefile Kconfig updates for v5.3 2019-07-12 16:06:27 -07:00