All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] x86/IRQ: consolidate IRQ disabling when acquiring vector lock
@ 2011-11-03 14:27 Jan Beulich
  2011-11-03 14:50 ` Andrew Cooper
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2011-11-03 14:27 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com

[-- Attachment #1: Type: text/plain, Size: 1482 bytes --]

x86/IRQ: consolidate IRQ disabling when acquiring vector lock

__assign_irq_vector() doesn't need to disable interrupts (its callers
are required to when acquiring the lock), and set_desc_affinity() can
use the normal spin lock primitives.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -429,7 +429,6 @@ static int __assign_irq_vector(
     static int current_vector = FIRST_DYNAMIC_VECTOR, current_offset = 0;
     unsigned int old_vector;
     int cpu, err;
-    unsigned long flags;
     cpumask_t tmp_mask;
     vmask_t *irq_used_vectors = NULL;
 
@@ -493,7 +492,6 @@ next:
         /* Found one! */
         current_vector = vector;
         current_offset = offset;
-        local_irq_save(flags);
         if (old_vector) {
             desc->arch.move_in_progress = 1;
             cpumask_copy(desc->arch.old_cpu_mask, desc->arch.cpu_mask);
@@ -521,7 +519,6 @@ next:
         }
 
         err = 0;
-        local_irq_restore(flags);
         break;
     }
     return err;
@@ -720,11 +717,9 @@ unsigned int set_desc_affinity(struct ir
 
     irq = desc->irq;
 
-    local_irq_save(flags);
-    lock_vector_lock();
+    spin_lock_irqsave(&vector_lock, flags);
     ret = __assign_irq_vector(irq, desc, mask);
-    unlock_vector_lock();
-    local_irq_restore(flags);
+    spin_unlock_irqrestore(&vector_lock, flags);
 
     if (ret < 0)
         return BAD_APICID;




[-- Attachment #2: x86-vector-lock-flags.patch --]
[-- Type: text/plain, Size: 1476 bytes --]

x86/IRQ: consolidate IRQ disabling when acquiring vector lock

__assign_irq_vector() doesn't need to disable interrupts (its callers
are required to when acquiring the lock), and set_desc_affinity() can
use the normal spin lock primitives.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -429,7 +429,6 @@ static int __assign_irq_vector(
     static int current_vector = FIRST_DYNAMIC_VECTOR, current_offset = 0;
     unsigned int old_vector;
     int cpu, err;
-    unsigned long flags;
     cpumask_t tmp_mask;
     vmask_t *irq_used_vectors = NULL;
 
@@ -493,7 +492,6 @@ next:
         /* Found one! */
         current_vector = vector;
         current_offset = offset;
-        local_irq_save(flags);
         if (old_vector) {
             desc->arch.move_in_progress = 1;
             cpumask_copy(desc->arch.old_cpu_mask, desc->arch.cpu_mask);
@@ -521,7 +519,6 @@ next:
         }
 
         err = 0;
-        local_irq_restore(flags);
         break;
     }
     return err;
@@ -720,11 +717,9 @@ unsigned int set_desc_affinity(struct ir
 
     irq = desc->irq;
 
-    local_irq_save(flags);
-    lock_vector_lock();
+    spin_lock_irqsave(&vector_lock, flags);
     ret = __assign_irq_vector(irq, desc, mask);
-    unlock_vector_lock();
-    local_irq_restore(flags);
+    spin_unlock_irqrestore(&vector_lock, flags);
 
     if (ret < 0)
         return BAD_APICID;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] x86/IRQ: consolidate IRQ disabling when acquiring vector lock
  2011-11-03 14:27 [PATCH 2/2] x86/IRQ: consolidate IRQ disabling when acquiring vector lock Jan Beulich
@ 2011-11-03 14:50 ` Andrew Cooper
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2011-11-03 14:50 UTC (permalink / raw)
  To: xen-devel

On 03/11/11 14:27, Jan Beulich wrote:
> x86/IRQ: consolidate IRQ disabling when acquiring vector lock
>
> __assign_irq_vector() doesn't need to disable interrupts (its callers
> are required to when acquiring the lock), and set_desc_affinity() can
> use the normal spin lock primitives.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

> --- a/xen/arch/x86/irq.c
> +++ b/xen/arch/x86/irq.c
> @@ -429,7 +429,6 @@ static int __assign_irq_vector(
>      static int current_vector = FIRST_DYNAMIC_VECTOR, current_offset = 0;
>      unsigned int old_vector;
>      int cpu, err;
> -    unsigned long flags;
>      cpumask_t tmp_mask;
>      vmask_t *irq_used_vectors = NULL;
>  
> @@ -493,7 +492,6 @@ next:
>          /* Found one! */
>          current_vector = vector;
>          current_offset = offset;
> -        local_irq_save(flags);
>          if (old_vector) {
>              desc->arch.move_in_progress = 1;
>              cpumask_copy(desc->arch.old_cpu_mask, desc->arch.cpu_mask);
> @@ -521,7 +519,6 @@ next:
>          }
>  
>          err = 0;
> -        local_irq_restore(flags);
>          break;
>      }
>      return err;
> @@ -720,11 +717,9 @@ unsigned int set_desc_affinity(struct ir
>  
>      irq = desc->irq;
>  
> -    local_irq_save(flags);
> -    lock_vector_lock();
> +    spin_lock_irqsave(&vector_lock, flags);
>      ret = __assign_irq_vector(irq, desc, mask);
> -    unlock_vector_lock();
> -    local_irq_restore(flags);
> +    spin_unlock_irqrestore(&vector_lock, flags);
>  
>      if (ret < 0)
>          return BAD_APICID;
>
>
>

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-03 14:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-03 14:27 [PATCH 2/2] x86/IRQ: consolidate IRQ disabling when acquiring vector lock Jan Beulich
2011-11-03 14:50 ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.