public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] LoongArch: KVM: Add paravirt qspinlock support
@ 2024-07-23  7:38 Bibo Mao
  2024-07-23  7:38 ` [PATCH 1/2] LoongArch: KVM: Add paravirt qspinlock in kvm side Bibo Mao
  2024-07-23  7:38 ` [PATCH 2/2] LoongArch: KVM: Add paravirt qspinlock in guest side Bibo Mao
  0 siblings, 2 replies; 6+ messages in thread
From: Bibo Mao @ 2024-07-23  7:38 UTC (permalink / raw)
  To: Huacai Chen, Tianrui Zhao, Peter Zijlstra, Waiman Long
  Cc: WANG Xuerui, loongarch, linux-kernel, kvm, virtualization

Lock Holder Preemption (LHP) is classic problem especially on VM, if
lock holder vCPU is preempted on host, other vCPUs will do busy looping
and waste pCPU time. And there is no hw Pause Loop Exiting (PLE) supported
on LoongArch system also.

Here pavavirt qspinlock is introduced, by the kernel compiling test, it
improves performance greatly if pVCPU is shared by multiple vCPUs. The
testbed is on 3C5000 Dual-way machine with 32 cores and 2 numa nodes,
test case is kcbench on kernel mainline 5.10, the detailed command is
"kcbench --src /root/src/linux"

Performance on host machine
                      kernel compile time       performance impact
   Original           150.29 seconds
   With patch         150.20 seconds            almost no impact

Performance on virtual machine:
1. 1 VM  with 32 vCPUs and 2 numa node
                      kernel compile time       performance impact
   Original           173.07 seconds
   With patch         171.73 seconds            +1%

2. 2 VMs with 32 vCPUs and 2 numa node
                      kernel compile time       performance impact
   Original           2362.04 seconds
   With patch         354.17 seconds            +566%

Bibo Mao (2):
  LoongArch: KVM: Add paravirt qspinlock in kvm side
  LoongArch: KVM: Add paravirt qspinlock in guest side

 arch/loongarch/Kconfig                        | 14 +++
 arch/loongarch/include/asm/Kbuild             |  1 -
 arch/loongarch/include/asm/kvm_host.h         |  4 +
 arch/loongarch/include/asm/kvm_para.h         |  1 +
 arch/loongarch/include/asm/loongarch.h        |  1 +
 arch/loongarch/include/asm/paravirt.h         | 47 ++++++++++
 arch/loongarch/include/asm/qspinlock.h        | 39 ++++++++
 .../include/asm/qspinlock_paravirt.h          |  6 ++
 arch/loongarch/kernel/paravirt.c              | 88 +++++++++++++++++++
 arch/loongarch/kernel/smp.c                   |  4 +-
 arch/loongarch/kvm/exit.c                     | 24 ++++-
 arch/loongarch/kvm/vcpu.c                     | 13 ++-
 12 files changed, 238 insertions(+), 4 deletions(-)
 create mode 100644 arch/loongarch/include/asm/qspinlock.h
 create mode 100644 arch/loongarch/include/asm/qspinlock_paravirt.h


base-commit: 7846b618e0a4c3e08888099d1d4512722b39ca99
-- 
2.39.3


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

end of thread, other threads:[~2024-07-24  2:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-23  7:38 [PATCH 0/2] LoongArch: KVM: Add paravirt qspinlock support Bibo Mao
2024-07-23  7:38 ` [PATCH 1/2] LoongArch: KVM: Add paravirt qspinlock in kvm side Bibo Mao
2024-07-23  7:38 ` [PATCH 2/2] LoongArch: KVM: Add paravirt qspinlock in guest side Bibo Mao
2024-07-23 19:57   ` kernel test robot
2024-07-24  1:29     ` maobibo
2024-07-24  2:52   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox