[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 5/5] x86/xen: Don't register PV spinlock IPI when it isn't going to be used



On 12/24/20 6:53 AM, David Woodhouse wrote:
> From: David Woodhouse <dwmw@xxxxxxxxxxxx>
>
> When xen_have_vector_callback is false, we still register the PV spinlock
> kicker IPI on the secondary CPUs. Stop doing that.
>
> Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
> ---
>  arch/x86/xen/spinlock.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c
> index 799f4eba0a62..b240ea483e63 100644
> --- a/arch/x86/xen/spinlock.c
> +++ b/arch/x86/xen/spinlock.c
> @@ -68,7 +68,7 @@ void xen_init_lock_cpu(int cpu)
>       int irq;
>       char *name;
>  
> -     if (!xen_pvspin)
> +     if (!xen_pvspin || !xen_have_vector_callback)
>               return;
>  
>       WARN(per_cpu(lock_kicker_irq, cpu) >= 0, "spinlock on CPU%d exists on 
> IRQ%d!\n",
> @@ -93,7 +93,7 @@ void xen_init_lock_cpu(int cpu)
>  
>  void xen_uninit_lock_cpu(int cpu)
>  {
> -     if (!xen_pvspin)
> +     if (!xen_pvspin || !xen_have_vector_callback)
>               return;
>  
>       unbind_from_irqhandler(per_cpu(lock_kicker_irq, cpu), NULL);
> @@ -115,7 +115,7 @@ PV_CALLEE_SAVE_REGS_THUNK(xen_vcpu_stolen);
>  void __init xen_init_spinlocks(void)
>  {
>       /*  Don't need to use pvqspinlock code if there is only 1 vCPU. */
> -     if (num_possible_cpus() == 1 || nopvspin)
> +     if (num_possible_cpus() == 1 || nopvspin || !xen_have_vector_callback)


xen_init_spinlock() will not be called without vector callbacks so this test is 
not really necessary.


OTOH this also implies that we will never update virt_spin_lock_key.


-boris


>               xen_pvspin = false;
>  
>       if (!xen_pvspin) {



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.