aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-06-29 05:24:38 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-29 13:26:22 -0400
commita53da52fd743fd637637572838c0a7af23a2d038 (patch)
treeb62c205b609356db5bca378c6d04d6d899bfd499
parent74ffd553a3a7fbae34be70b751852d5b6fe5acac (diff)
[PATCH] genirq: cleanup: merge irq_affinity[] into irq_desc[]
Consolidation: remove the irq_affinity[NR_IRQS] array and move it into the irq_desc[NR_IRQS].affinity field. [akpm@osdl.org: sparc64 build fix] Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/alpha/kernel/irq.c2
-rw-r--r--arch/i386/kernel/irq.c2
-rw-r--r--arch/ia64/kernel/irq.c4
-rw-r--r--arch/parisc/kernel/irq.c8
-rw-r--r--arch/powerpc/kernel/irq.c2
-rw-r--r--arch/powerpc/platforms/pseries/xics.c4
-rw-r--r--arch/powerpc/sysdev/mpic.c2
-rw-r--r--arch/ppc/syslib/open_pic.c4
-rw-r--r--arch/sparc64/kernel/irq.c2
-rw-r--r--arch/x86_64/kernel/irq.c2
-rw-r--r--include/linux/irq.h7
-rw-r--r--kernel/irq/handle.c5
-rw-r--r--kernel/irq/manage.c2
-rw-r--r--kernel/irq/proc.c4
14 files changed, 26 insertions, 24 deletions
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c
index ec9d243d42c9..63af36cf7f6e 100644
--- a/arch/alpha/kernel/irq.c
+++ b/arch/alpha/kernel/irq.c
@@ -56,7 +56,7 @@ select_smp_affinity(unsigned int irq)
56 cpu = (cpu < (NR_CPUS-1) ? cpu + 1 : 0); 56 cpu = (cpu < (NR_CPUS-1) ? cpu + 1 : 0);
57 last_cpu = cpu; 57 last_cpu = cpu;
58 58
59 irq_affinity[irq] = cpumask_of_cpu(cpu); 59 irq_desc[irq].affinity = cpumask_of_cpu(cpu);
60 irq_desc[irq].chip->set_affinity(irq, cpumask_of_cpu(cpu)); 60 irq_desc[irq].chip->set_affinity(irq, cpumask_of_cpu(cpu));
61 return 0; 61 return 0;
62} 62}
diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c
index b942a5918dab..3336cef9605a 100644
--- a/arch/i386/kernel/irq.c
+++ b/arch/i386/kernel/irq.c
@@ -291,7 +291,7 @@ void fixup_irqs(cpumask_t map)
291 if (irq == 2) 291 if (irq == 2)
292 continue; 292 continue;
293 293
294 cpus_and(mask, irq_affinity[irq], map); 294 cpus_and(mask, irq_desc[irq].affinity, map);
295 if (any_online_cpu(mask) == NR_CPUS) { 295 if (any_online_cpu(mask) == NR_CPUS) {
296 printk("Breaking affinity for irq %i\n", irq); 296 printk("Breaking affinity for irq %i\n", irq);
297 mask = map; 297 mask = map;
diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c
index 2645153dba8a..c4e1b3b60b48 100644
--- a/arch/ia64/kernel/irq.c
+++ b/arch/ia64/kernel/irq.c
@@ -100,7 +100,7 @@ void set_irq_affinity_info (unsigned int irq, int hwid, int redir)
100 cpu_set(cpu_logical_id(hwid), mask); 100 cpu_set(cpu_logical_id(hwid), mask);
101 101
102 if (irq < NR_IRQS) { 102 if (irq < NR_IRQS) {
103 irq_affinity[irq] = mask; 103 irq_desc[irq].affinity = mask;
104 irq_redir[irq] = (char) (redir & 0xff); 104 irq_redir[irq] = (char) (redir & 0xff);
105 } 105 }
106} 106}
@@ -131,7 +131,7 @@ static void migrate_irqs(void)
131 if (desc->status == IRQ_PER_CPU) 131 if (desc->status == IRQ_PER_CPU)
132 continue; 132 continue;
133 133
134 cpus_and(mask, irq_affinity[irq], cpu_online_map); 134 cpus_and(mask, irq_desc[irq].affinity, cpu_online_map);
135 if (any_online_cpu(mask) == NR_CPUS) { 135 if (any_online_cpu(mask) == NR_CPUS) {
136 /* 136 /*
137 * Save it for phase 2 processing 137 * Save it for phase 2 processing
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index 26e69f73fdb0..ea6a55e1a0c5 100644
--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
@@ -94,7 +94,7 @@ int cpu_check_affinity(unsigned int irq, cpumask_t *dest)
94 if (irq == TIMER_IRQ || irq == IPI_IRQ) { 94 if (irq == TIMER_IRQ || irq == IPI_IRQ) {
95 /* Bad linux design decision. The mask has already 95 /* Bad linux design decision. The mask has already
96 * been set; we must reset it */ 96 * been set; we must reset it */
97 irq_affinity[irq] = CPU_MASK_ALL; 97 irq_desc[irq].affinity = CPU_MASK_ALL;
98 return -EINVAL; 98 return -EINVAL;
99 } 99 }
100 100
@@ -110,7 +110,7 @@ static void cpu_set_affinity_irq(unsigned int irq, cpumask_t dest)
110 if (cpu_check_affinity(irq, &dest)) 110 if (cpu_check_affinity(irq, &dest))
111 return; 111 return;
112 112
113 irq_affinity[irq] = dest; 113 irq_desc[irq].affinity = dest;
114} 114}
115#endif 115#endif
116 116
@@ -265,7 +265,7 @@ int txn_alloc_irq(unsigned int bits_wide)
265unsigned long txn_affinity_addr(unsigned int irq, int cpu) 265unsigned long txn_affinity_addr(unsigned int irq, int cpu)
266{ 266{
267#ifdef CONFIG_SMP 267#ifdef CONFIG_SMP
268 irq_affinity[irq] = cpumask_of_cpu(cpu); 268 irq_desc[irq].affinity = cpumask_of_cpu(cpu);
269#endif 269#endif
270 270
271 return cpu_data[cpu].txn_addr; 271 return cpu_data[cpu].txn_addr;
@@ -326,7 +326,7 @@ void do_cpu_irq_mask(struct pt_regs *regs)
326 /* Work our way from MSb to LSb...same order we alloc EIRs */ 326 /* Work our way from MSb to LSb...same order we alloc EIRs */
327 for (irq = TIMER_IRQ; eirr_val && bit; bit>>=1, irq++) { 327 for (irq = TIMER_IRQ; eirr_val && bit; bit>>=1, irq++) {
328#ifdef CONFIG_SMP 328#ifdef CONFIG_SMP
329 cpumask_t dest = irq_affinity[irq]; 329 cpumask_t dest = irq_desc[irq].affinity;
330#endif 330#endif
331 if (!(bit & eirr_val)) 331 if (!(bit & eirr_val))
332 continue; 332 continue;
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 8cfc779d882d..24f6050aa4ab 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -164,7 +164,7 @@ void fixup_irqs(cpumask_t map)
164 if (irq_desc[irq].status & IRQ_PER_CPU) 164 if (irq_desc[irq].status & IRQ_PER_CPU)
165 continue; 165 continue;
166 166
167 cpus_and(mask, irq_affinity[irq], map); 167 cpus_and(mask, irq_desc[irq].affinity, map);
168 if (any_online_cpu(mask) == NR_CPUS) { 168 if (any_online_cpu(mask) == NR_CPUS) {
169 printk("Breaking affinity for irq %i\n", irq); 169 printk("Breaking affinity for irq %i\n", irq);
170 mask = map; 170 mask = map;
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index bdc9e26a93cf..19c03dd43000 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -238,7 +238,7 @@ static int get_irq_server(unsigned int irq)
238{ 238{
239 unsigned int server; 239 unsigned int server;
240 /* For the moment only implement delivery to all cpus or one cpu */ 240 /* For the moment only implement delivery to all cpus or one cpu */
241 cpumask_t cpumask = irq_affinity[irq]; 241 cpumask_t cpumask = irq_desc[irq].affinity;
242 cpumask_t tmp = CPU_MASK_NONE; 242 cpumask_t tmp = CPU_MASK_NONE;
243 243
244 if (!distribute_irqs) 244 if (!distribute_irqs)
@@ -729,7 +729,7 @@ void xics_migrate_irqs_away(void)
729 729
730 /* Reset affinity to all cpus */ 730 /* Reset affinity to all cpus */
731 desc->chip->set_affinity(virq, CPU_MASK_ALL); 731 desc->chip->set_affinity(virq, CPU_MASK_ALL);
732 irq_affinity[virq] = CPU_MASK_ALL; 732 irq_desc[irq].affinity = CPU_MASK_ALL;
733unlock: 733unlock:
734 spin_unlock_irqrestore(&desc->lock, flags); 734 spin_unlock_irqrestore(&desc->lock, flags);
735 } 735 }
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index f4613ee6b7a2..28df9c827ca6 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -906,7 +906,7 @@ void mpic_setup_this_cpu(void)
906 /* let the mpic know we want intrs. default affinity is 0xffffffff 906 /* let the mpic know we want intrs. default affinity is 0xffffffff
907 * until changed via /proc. That's how it's done on x86. If we want 907 * until changed via /proc. That's how it's done on x86. If we want
908 * it differently, then we should make sure we also change the default 908 * it differently, then we should make sure we also change the default
909 * values of irq_affinity in irq.c. 909 * values of irq_desc[].affinity in irq.c.
910 */ 910 */
911 if (distribute_irqs) { 911 if (distribute_irqs) {
912 for (i = 0; i < mpic->num_sources ; i++) 912 for (i = 0; i < mpic->num_sources ; i++)
diff --git a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c
index 822058c2983e..767a0bc95817 100644
--- a/arch/ppc/syslib/open_pic.c
+++ b/arch/ppc/syslib/open_pic.c
@@ -615,8 +615,8 @@ void __devinit do_openpic_setup_cpu(void)
615 /* let the openpic know we want intrs. default affinity 615 /* let the openpic know we want intrs. default affinity
616 * is 0xffffffff until changed via /proc 616 * is 0xffffffff until changed via /proc
617 * That's how it's done on x86. If we want it differently, then 617 * That's how it's done on x86. If we want it differently, then
618 * we should make sure we also change the default values of irq_affinity 618 * we should make sure we also change the default values of
619 * in irq.c. 619 * irq_desc[].affinity in irq.c.
620 */ 620 */
621 for (i = 0; i < NumSources; i++) 621 for (i = 0; i < NumSources; i++)
622 openpic_mapirq(i, msk, CPU_MASK_ALL); 622 openpic_mapirq(i, msk, CPU_MASK_ALL);
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index 5d7c821ab7f6..ab9e640df228 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -224,7 +224,7 @@ static inline struct ino_bucket *virt_irq_to_bucket(unsigned int virt_irq)
224#ifdef CONFIG_SMP 224#ifdef CONFIG_SMP
225static int irq_choose_cpu(unsigned int virt_irq) 225static int irq_choose_cpu(unsigned int virt_irq)
226{ 226{
227 cpumask_t mask = irq_affinity[virt_irq]; 227 cpumask_t mask = irq_desc[virt_irq].affinity;
228 int cpuid; 228 int cpuid;
229 229
230 if (cpus_equal(mask, CPU_MASK_ALL)) { 230 if (cpus_equal(mask, CPU_MASK_ALL)) {
diff --git a/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c
index 0c2fb2c77bd0..a1f1df5f7bfc 100644
--- a/arch/x86_64/kernel/irq.c
+++ b/arch/x86_64/kernel/irq.c
@@ -146,7 +146,7 @@ void fixup_irqs(cpumask_t map)
146 if (irq == 2) 146 if (irq == 2)
147 continue; 147 continue;
148 148
149 cpus_and(mask, irq_affinity[irq], map); 149 cpus_and(mask, irq_desc[irq].affinity, map);
150 if (any_online_cpu(mask) == NR_CPUS) { 150 if (any_online_cpu(mask) == NR_CPUS) {
151 printk("Breaking affinity for irq %i\n", irq); 151 printk("Breaking affinity for irq %i\n", irq);
152 mask = map; 152 mask = map;
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 9597a6904239..6e3ad6245bd3 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -77,6 +77,9 @@ typedef struct irq_desc {
77 unsigned int irq_count; /* For detecting broken interrupts */ 77 unsigned int irq_count; /* For detecting broken interrupts */
78 unsigned int irqs_unhandled; 78 unsigned int irqs_unhandled;
79 spinlock_t lock; 79 spinlock_t lock;
80#ifdef CONFIG_SMP
81 cpumask_t affinity;
82#endif
80#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) 83#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE)
81 unsigned int move_irq; /* Flag need to re-target intr dest*/ 84 unsigned int move_irq; /* Flag need to re-target intr dest*/
82#endif 85#endif
@@ -96,12 +99,10 @@ irq_descp (int irq)
96extern int setup_irq(unsigned int irq, struct irqaction * new); 99extern int setup_irq(unsigned int irq, struct irqaction * new);
97 100
98#ifdef CONFIG_GENERIC_HARDIRQS 101#ifdef CONFIG_GENERIC_HARDIRQS
99extern cpumask_t irq_affinity[NR_IRQS];
100
101#ifdef CONFIG_SMP 102#ifdef CONFIG_SMP
102static inline void set_native_irq_info(int irq, cpumask_t mask) 103static inline void set_native_irq_info(int irq, cpumask_t mask)
103{ 104{
104 irq_affinity[irq] = mask; 105 irq_desc[irq].affinity = mask;
105} 106}
106#else 107#else
107static inline void set_native_irq_info(int irq, cpumask_t mask) 108static inline void set_native_irq_info(int irq, cpumask_t mask)
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index f9d95705a4ac..cc786aaf30d6 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -32,7 +32,10 @@ irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = {
32 [0 ... NR_IRQS-1] = { 32 [0 ... NR_IRQS-1] = {
33 .status = IRQ_DISABLED, 33 .status = IRQ_DISABLED,
34 .chip = &no_irq_type, 34 .chip = &no_irq_type,
35 .lock = SPIN_LOCK_UNLOCKED 35 .lock = SPIN_LOCK_UNLOCKED,
36#ifdef CONFIG_SMP
37 .affinity = CPU_MASK_ALL
38#endif
36 } 39 }
37}; 40};
38 41
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 31ee1f3bfcf9..c53662edc73d 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -16,8 +16,6 @@
16 16
17#ifdef CONFIG_SMP 17#ifdef CONFIG_SMP
18 18
19cpumask_t irq_affinity[NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL };
20
21#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) 19#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE)
22cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS]; 20cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS];
23#endif 21#endif
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 90fe05f23e69..847b98a611e0 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -36,7 +36,7 @@ void proc_set_irq_affinity(unsigned int irq, cpumask_t mask_val)
36void proc_set_irq_affinity(unsigned int irq, cpumask_t mask_val) 36void proc_set_irq_affinity(unsigned int irq, cpumask_t mask_val)
37{ 37{
38 set_balance_irq_affinity(irq, mask_val); 38 set_balance_irq_affinity(irq, mask_val);
39 irq_affinity[irq] = mask_val; 39 irq_desc[irq].affinity = mask_val;
40 irq_desc[irq].chip->set_affinity(irq, mask_val); 40 irq_desc[irq].chip->set_affinity(irq, mask_val);
41} 41}
42#endif 42#endif
@@ -44,7 +44,7 @@ void proc_set_irq_affinity(unsigned int irq, cpumask_t mask_val)
44static int irq_affinity_read_proc(char *page, char **start, off_t off, 44static int irq_affinity_read_proc(char *page, char **start, off_t off,
45 int count, int *eof, void *data) 45 int count, int *eof, void *data)
46{ 46{
47 int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]); 47 int len = cpumask_scnprintf(page, count, irq_desc[(long)data].affinity);
48 48
49 if (count - len < 2) 49 if (count - len < 2)
50 return -EINVAL; 50 return -EINVAL;