diff options
author | Yinghai Lu <yinghai@kernel.org> | 2009-04-27 21:00:38 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-28 06:21:17 -0400 |
commit | 85ac16d033370caf6f48d743c8dc8103700f5cc5 (patch) | |
tree | 04a73af31c07a8ad29780b777b3f9d041fa236fa /include | |
parent | 57b150cce8e004ddd36330490a68bfb59b7271e9 (diff) |
x86/irq: change irq_desc_alloc() to take node instead of cpu
This simplifies the node awareness of the code. All our allocators
only deal with a NUMA node ID locality not with CPU ids anyway - so
there's no need to maintain (and transform) a CPU id all across the
IRq layer.
v2: keep move_irq_desc related
[ Impact: cleanup, prepare IRQ code to be NUMA-aware ]
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
LKML-Reference: <49F65536.2020300@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/interrupt.h | 2 | ||||
-rw-r--r-- | include/linux/irq.h | 16 |
2 files changed, 7 insertions, 11 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 91bb76f44f14..ff374ceface0 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -566,6 +566,6 @@ struct irq_desc; | |||
566 | extern int early_irq_init(void); | 566 | extern int early_irq_init(void); |
567 | extern int arch_probe_nr_irqs(void); | 567 | extern int arch_probe_nr_irqs(void); |
568 | extern int arch_early_irq_init(void); | 568 | extern int arch_early_irq_init(void); |
569 | extern int arch_init_chip_data(struct irq_desc *desc, int cpu); | 569 | extern int arch_init_chip_data(struct irq_desc *desc, int node); |
570 | 570 | ||
571 | #endif | 571 | #endif |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 8e4c18b29157..a09baf8f9d99 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -187,7 +187,7 @@ struct irq_desc { | |||
187 | spinlock_t lock; | 187 | spinlock_t lock; |
188 | #ifdef CONFIG_SMP | 188 | #ifdef CONFIG_SMP |
189 | cpumask_var_t affinity; | 189 | cpumask_var_t affinity; |
190 | unsigned int cpu; | 190 | unsigned int node; |
191 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 191 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
192 | cpumask_var_t pending_mask; | 192 | cpumask_var_t pending_mask; |
193 | #endif | 193 | #endif |
@@ -201,16 +201,16 @@ struct irq_desc { | |||
201 | } ____cacheline_internodealigned_in_smp; | 201 | } ____cacheline_internodealigned_in_smp; |
202 | 202 | ||
203 | extern void arch_init_copy_chip_data(struct irq_desc *old_desc, | 203 | extern void arch_init_copy_chip_data(struct irq_desc *old_desc, |
204 | struct irq_desc *desc, int cpu); | 204 | struct irq_desc *desc, int node); |
205 | extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc); | 205 | extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc); |
206 | 206 | ||
207 | #ifndef CONFIG_SPARSE_IRQ | 207 | #ifndef CONFIG_SPARSE_IRQ |
208 | extern struct irq_desc irq_desc[NR_IRQS]; | 208 | extern struct irq_desc irq_desc[NR_IRQS]; |
209 | #else /* CONFIG_SPARSE_IRQ */ | 209 | #else /* CONFIG_SPARSE_IRQ */ |
210 | extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu); | 210 | extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int node); |
211 | #endif /* CONFIG_SPARSE_IRQ */ | 211 | #endif /* CONFIG_SPARSE_IRQ */ |
212 | 212 | ||
213 | extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu); | 213 | extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node); |
214 | 214 | ||
215 | /* | 215 | /* |
216 | * Migration helpers for obsolete names, they will go away: | 216 | * Migration helpers for obsolete names, they will go away: |
@@ -422,12 +422,10 @@ extern int set_irq_msi(unsigned int irq, struct msi_desc *entry); | |||
422 | * Allocates affinity and pending_mask cpumask if required. | 422 | * Allocates affinity and pending_mask cpumask if required. |
423 | * Returns true if successful (or not required). | 423 | * Returns true if successful (or not required). |
424 | */ | 424 | */ |
425 | static inline bool alloc_desc_masks(struct irq_desc *desc, int cpu, | 425 | static inline bool alloc_desc_masks(struct irq_desc *desc, int node, |
426 | bool boot) | 426 | bool boot) |
427 | { | 427 | { |
428 | #ifdef CONFIG_CPUMASK_OFFSTACK | 428 | #ifdef CONFIG_CPUMASK_OFFSTACK |
429 | int node; | ||
430 | |||
431 | if (boot) { | 429 | if (boot) { |
432 | alloc_bootmem_cpumask_var(&desc->affinity); | 430 | alloc_bootmem_cpumask_var(&desc->affinity); |
433 | 431 | ||
@@ -437,8 +435,6 @@ static inline bool alloc_desc_masks(struct irq_desc *desc, int cpu, | |||
437 | return true; | 435 | return true; |
438 | } | 436 | } |
439 | 437 | ||
440 | node = cpu_to_node(cpu); | ||
441 | |||
442 | if (!alloc_cpumask_var_node(&desc->affinity, GFP_ATOMIC, node)) | 438 | if (!alloc_cpumask_var_node(&desc->affinity, GFP_ATOMIC, node)) |
443 | return false; | 439 | return false; |
444 | 440 | ||
@@ -494,7 +490,7 @@ static inline void free_desc_masks(struct irq_desc *old_desc, | |||
494 | 490 | ||
495 | #else /* !CONFIG_SMP */ | 491 | #else /* !CONFIG_SMP */ |
496 | 492 | ||
497 | static inline bool alloc_desc_masks(struct irq_desc *desc, int cpu, | 493 | static inline bool alloc_desc_masks(struct irq_desc *desc, int node, |
498 | bool boot) | 494 | bool boot) |
499 | { | 495 | { |
500 | return true; | 496 | return true; |