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

Re: [Xen-devel] [PATCH 1/2] xen: allow on_selected_cpus with interrupts disabled



On 03/05/2013 15:58, "Stefano Stabellini" <stefano.stabellini@xxxxxxxxxxxxx>
wrote:

> Allow on_selected_cpus with interrupts disabled, use it with care.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

NACK. The potential for deadlock is obvious, unclear what 'with care' might
entail.

 -- Keir

> ---
>  xen/common/smp.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/common/smp.c b/xen/common/smp.c
> index dcd93ad..7deb97c 100644
> --- a/xen/common/smp.c
> +++ b/xen/common/smp.c
> @@ -33,10 +33,9 @@ void on_selected_cpus(
>      int wait)
>  {
>      unsigned int nr_cpus;
> +    unsigned long flags;
>  
> -    ASSERT(local_irq_is_enabled());
> -
> -    spin_lock(&call_lock);
> +    spin_lock_irqsave(&call_lock, flags);
>  
>      cpumask_copy(&call_data.selected, selected);
>  
> @@ -54,7 +53,7 @@ void on_selected_cpus(
>          cpu_relax();
>  
>  out:
> -    spin_unlock(&call_lock);
> +    spin_unlock_irqrestore(&call_lock, flags);
>  }
>  
>  void smp_call_function_interrupt(void)



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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