mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: johnnyaiai <arafatms@outlook.com>
To: jgross@suse.com
Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, hpa@zytor.com,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	johnnyaiai <johnnyaiai@tencent.com>
Subject: [PATCH] locking/paravirt: Fix performance regression on core bonded vCPU
Date: Thu,  3 Nov 2022 20:13:19 +0800	[thread overview]
Message-ID: <MEYP282MB402614DB5A4625255B689F06C3389@MEYP282MB4026.AUSP282.PROD.OUTLOOK.COM> (raw)

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


             reply	other threads:[~2022-11-03 12:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03 12:13 johnnyaiai [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MEYP282MB402614DB5A4625255B689F06C3389@MEYP282MB4026.AUSP282.PROD.OUTLOOK.COM \
    --to=arafatms@outlook.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=johnnyaiai@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®