mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] locking/paravirt: Fix performance regression on core bonded vCPU
@ 2022-11-03 12:13 johnnyaiai
  2022-11-03 13:22 ` Juergen Gross
  0 siblings, 1 reply; 5+ messages in thread
From: johnnyaiai @ 2022-11-03 12:13 UTC (permalink / raw)
  To: jgross
  Cc: tglx, mingo, bp, dave.hansen, hpa, linux-kernel, virtualization,
	johnnyaiai

From: johnnyaiai <johnnyaiai@tencent.com>

virt_spin_lock() is preferred over native qspinlock when
vCPU is preempted. But brings a lot of regression while
vCPU is not preempted. Provide a early param 'novirtlock'
to choose would be better.

will-it-scale/lock2_threads -s 10 -t 64
baseline    afterpatch
559938       2166135

Signed-off-by: johnnyaiai <johnnyaiai@tencent.com>
---
 arch/x86/kernel/paravirt.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 59d3d2763..529cf23fe 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -107,6 +107,13 @@ static unsigned paravirt_patch_jmp(void *insn_buff, const void *target,
 
 DEFINE_STATIC_KEY_TRUE(virt_spin_lock_key);
 
+static __init int parse_novirtspin(char *arg)
+{
+	static_branch_disable(&virt_spin_lock_key);
+	return 0;
+}
+early_param("novirtspin", parse_novirtspin);
+
 void __init native_pv_lock_init(void)
 {
 	if (!boot_cpu_has(X86_FEATURE_HYPERVISOR))
-- 
2.27.0


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH] locking/paravirt: Fix performance regression on core bonded vCPU
@ 2022-11-03 12:10 johnnyaiai
  0 siblings, 0 replies; 5+ messages in thread
From: johnnyaiai @ 2022-11-03 12:10 UTC (permalink / raw)
  To: jgross
  Cc: tglx, mingo, bp, dave.hansen, hpa, linux-kernel, virtualization,
	johnnyaiai

From: johnnyaiai <johnnyaiai@tencent.com>

virt_spin_lock() is preferred over native qspinlock when
vCPU is preempted. But brings a lot of regression while
vCPU is not preempted. Provide a early param 'novirtlock'
to choose would be better.

will-it-scale/lock2_threads -s 10 -t 64
baseline    afterpatch
559938       2166135

Signed-off-by: johnnyaiai <johnnyaiai@tencent.com>
---
 kernel/locking/qspinlock.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 59d3d2763..529cf23fe 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -107,6 +107,13 @@ static unsigned paravirt_patch_jmp(void *insn_buff, const void *target,
 
 DEFINE_STATIC_KEY_TRUE(virt_spin_lock_key);
 
+static __init int parse_novirtspin(char *arg)
+{
+	static_branch_disable(&virt_spin_lock_key);
+	return 0;
+}
+early_param("novirtspin", parse_novirtspin);
+
 void __init native_pv_lock_init(void)
 {
 	if (!boot_cpu_has(X86_FEATURE_HYPERVISOR))
-- 
2.27.0


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

end of thread, other threads:[~2022-11-03 14:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-03 12:13 [PATCH] locking/paravirt: Fix performance regression on core bonded vCPU johnnyaiai
2022-11-03 13:22 ` Juergen Gross
2022-11-03 13:58   ` johnnyaiai
2022-11-03 14:09     ` Juergen Gross
  -- strict thread matches above, loose matches on Subject: below --
2022-11-03 12:10 johnnyaiai

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

all inboxes | Powered by JetHome®