[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <22f2465a-128e-730f-bc51-5a55ef16a039@oracle.com>
Date: Thu, 19 Jul 2018 15:18:58 -0400
From: Boris Ostrovsky <boris.ostrovsky@...cle.com>
To: Waiman Long <longman@...hat.com>, Juergen Gross <jgross@...e.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>
Cc: x86@...nel.org, xen-devel@...ts.xenproject.org,
linux-kernel@...r.kernel.org,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Subject: Re: [PATCH] xen/spinlock: Don't use pvqspinlock if only 1 vCPU
On 07/19/2018 09:48 AM, Waiman Long wrote:
> On a VM with only 1 vCPU, the locking fast paths will always be
> successful. In this case, there is no need to use the the PV qspinlock
> code which has higher overhead on the unlock side than the native
> qspinlock code.
>
> Signed-off-by: Waiman Long <longman@...hat.com>
> ---
> arch/x86/xen/spinlock.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c
> index cd97a62..38f47ae 100644
> --- a/arch/x86/xen/spinlock.c
> +++ b/arch/x86/xen/spinlock.c
> @@ -130,7 +130,8 @@ void xen_uninit_lock_cpu(int cpu)
> void __init xen_init_spinlocks(void)
> {
>
> - if (!xen_pvspin) {
> + /* Don't need to use pvqspinlock code if there is only 1 vCPU. */
> + if (!xen_pvspin || num_possible_cpus() == 1) {
> printk(KERN_DEBUG "xen: PV spinlocks disabled\n");
> return;
> }
I think we need to set xen_pvspin to false for such configurations.
Notice that xen_init_lock_cpu() will try to perform some additional
pvspinlock initializations.
-boris
Powered by blists - more mailing lists