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 /drivers/pci/intr_remapping.c | |
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 'drivers/pci/intr_remapping.c')
-rw-r--r-- | drivers/pci/intr_remapping.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c index f5e0ea724a6f..9eff36a293e0 100644 --- a/drivers/pci/intr_remapping.c +++ b/drivers/pci/intr_remapping.c | |||
@@ -23,15 +23,12 @@ struct irq_2_iommu { | |||
23 | }; | 23 | }; |
24 | 24 | ||
25 | #ifdef CONFIG_GENERIC_HARDIRQS | 25 | #ifdef CONFIG_GENERIC_HARDIRQS |
26 | static struct irq_2_iommu *get_one_free_irq_2_iommu(int cpu) | 26 | static struct irq_2_iommu *get_one_free_irq_2_iommu(int node) |
27 | { | 27 | { |
28 | struct irq_2_iommu *iommu; | 28 | struct irq_2_iommu *iommu; |
29 | int node; | ||
30 | |||
31 | node = cpu_to_node(cpu); | ||
32 | 29 | ||
33 | iommu = kzalloc_node(sizeof(*iommu), GFP_ATOMIC, node); | 30 | iommu = kzalloc_node(sizeof(*iommu), GFP_ATOMIC, node); |
34 | printk(KERN_DEBUG "alloc irq_2_iommu on cpu %d node %d\n", cpu, node); | 31 | printk(KERN_DEBUG "alloc irq_2_iommu on node %d\n", node); |
35 | 32 | ||
36 | return iommu; | 33 | return iommu; |
37 | } | 34 | } |
@@ -48,7 +45,7 @@ static struct irq_2_iommu *irq_2_iommu(unsigned int irq) | |||
48 | return desc->irq_2_iommu; | 45 | return desc->irq_2_iommu; |
49 | } | 46 | } |
50 | 47 | ||
51 | static struct irq_2_iommu *irq_2_iommu_alloc_cpu(unsigned int irq, int cpu) | 48 | static struct irq_2_iommu *irq_2_iommu_alloc_node(unsigned int irq, int node) |
52 | { | 49 | { |
53 | struct irq_desc *desc; | 50 | struct irq_desc *desc; |
54 | struct irq_2_iommu *irq_iommu; | 51 | struct irq_2_iommu *irq_iommu; |
@@ -56,7 +53,7 @@ static struct irq_2_iommu *irq_2_iommu_alloc_cpu(unsigned int irq, int cpu) | |||
56 | /* | 53 | /* |
57 | * alloc irq desc if not allocated already. | 54 | * alloc irq desc if not allocated already. |
58 | */ | 55 | */ |
59 | desc = irq_to_desc_alloc_cpu(irq, cpu); | 56 | desc = irq_to_desc_alloc_node(irq, node); |
60 | if (!desc) { | 57 | if (!desc) { |
61 | printk(KERN_INFO "can not get irq_desc for %d\n", irq); | 58 | printk(KERN_INFO "can not get irq_desc for %d\n", irq); |
62 | return NULL; | 59 | return NULL; |
@@ -65,14 +62,14 @@ static struct irq_2_iommu *irq_2_iommu_alloc_cpu(unsigned int irq, int cpu) | |||
65 | irq_iommu = desc->irq_2_iommu; | 62 | irq_iommu = desc->irq_2_iommu; |
66 | 63 | ||
67 | if (!irq_iommu) | 64 | if (!irq_iommu) |
68 | desc->irq_2_iommu = get_one_free_irq_2_iommu(cpu); | 65 | desc->irq_2_iommu = get_one_free_irq_2_iommu(node); |
69 | 66 | ||
70 | return desc->irq_2_iommu; | 67 | return desc->irq_2_iommu; |
71 | } | 68 | } |
72 | 69 | ||
73 | static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq) | 70 | static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq) |
74 | { | 71 | { |
75 | return irq_2_iommu_alloc_cpu(irq, boot_cpu_id); | 72 | return irq_2_iommu_alloc_node(irq, cpu_to_node(boot_cpu_id)); |
76 | } | 73 | } |
77 | 74 | ||
78 | #else /* !CONFIG_SPARSE_IRQ */ | 75 | #else /* !CONFIG_SPARSE_IRQ */ |