[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9d68a5e1-7880-4425-9a18-09c8e8b5ba26@suse.com>
Date: Thu, 23 May 2024 12:04:04 +0200
From: Juergen Gross <jgross@...e.com>
To: Chen Yu <yu.c.chen@...el.com>, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>
Cc: Ajay Kaher <ajay.kaher@...adcom.com>,
Alexey Makhalov <alexey.amakhalov@...adcom.com>,
Arnd Bergmann <arnd@...db.de>, "H. Peter Anvin" <hpa@...or.com>,
x86@...nel.org, virtualization@...ts.linux.dev,
linux-kernel@...r.kernel.org, Qiuxu Zhuo <qiuxu.zhuo@...el.com>,
Prem Nath Dey <prem.nath.dey@...el.com>,
Xiaoping Zhou <xiaoping.zhou@...el.com>
Subject: Re: [PATCH] x86/paravirt: Disable virt spinlock when
CONFIG_PARAVIRT_SPINLOCKS disabled
On 16.05.24 15:02, Chen Yu wrote:
> Performance drop is reported when running encode/decode workload and
> BenchSEE cache sub-workload.
> Bisect points to commit ce0a1b608bfc ("x86/paravirt: Silence unused
> native_pv_lock_init() function warning"). When CONFIG_PARAVIRT_SPINLOCKS
> is disabled the virt_spin_lock_key is set to true on bare-metal.
> The qspinlock degenerates to test-and-set spinlock, which decrease the
> performance on bare-metal.
>
> Fix this by disabling virt_spin_lock_key if CONFIG_PARAVIRT_SPINLOCKS
> is not set, or it is on bare-metal.
>
> Fixes: ce0a1b608bfc ("x86/paravirt: Silence unused native_pv_lock_init() function warning")
> Suggested-by: Qiuxu Zhuo <qiuxu.zhuo@...el.com>
> Reported-by: Prem Nath Dey <prem.nath.dey@...el.com>
> Reported-by: Xiaoping Zhou <xiaoping.zhou@...el.com>
> Signed-off-by: Chen Yu <yu.c.chen@...el.com>
Reviewed-by: Juergen Gross <jgross@...e.com>
Juergen
> ---
> arch/x86/kernel/paravirt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
> index 5358d43886ad..ee51c0949ed8 100644
> --- a/arch/x86/kernel/paravirt.c
> +++ b/arch/x86/kernel/paravirt.c
> @@ -55,7 +55,7 @@ DEFINE_STATIC_KEY_TRUE(virt_spin_lock_key);
>
> void __init native_pv_lock_init(void)
> {
> - if (IS_ENABLED(CONFIG_PARAVIRT_SPINLOCKS) &&
> + if (!IS_ENABLED(CONFIG_PARAVIRT_SPINLOCKS) ||
> !boot_cpu_has(X86_FEATURE_HYPERVISOR))
> static_branch_disable(&virt_spin_lock_key);
> }
Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3684 bytes)
Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (496 bytes)
Powered by blists - more mailing lists