mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Suresh Siddha <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Rusty Russell <[email protected]> Cc: Jeremy Fitzhardinge <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
57b150cce8
commit
85ac16d033
10 changed files with 66 additions and 97 deletions
|
|
@ -23,15 +23,12 @@ struct irq_2_iommu {
|
|||
};
|
||||
|
||||
#ifdef CONFIG_GENERIC_HARDIRQS
|
||||
static struct irq_2_iommu *get_one_free_irq_2_iommu(int cpu)
|
||||
static struct irq_2_iommu *get_one_free_irq_2_iommu(int node)
|
||||
{
|
||||
struct irq_2_iommu *iommu;
|
||||
int node;
|
||||
|
||||
node = cpu_to_node(cpu);
|
||||
|
||||
iommu = kzalloc_node(sizeof(*iommu), GFP_ATOMIC, node);
|
||||
printk(KERN_DEBUG "alloc irq_2_iommu on cpu %d node %d\n", cpu, node);
|
||||
printk(KERN_DEBUG "alloc irq_2_iommu on node %d\n", node);
|
||||
|
||||
return iommu;
|
||||
}
|
||||
|
|
@ -48,7 +45,7 @@ static struct irq_2_iommu *irq_2_iommu(unsigned int irq)
|
|||
return desc->irq_2_iommu;
|
||||
}
|
||||
|
||||
static struct irq_2_iommu *irq_2_iommu_alloc_cpu(unsigned int irq, int cpu)
|
||||
static struct irq_2_iommu *irq_2_iommu_alloc_node(unsigned int irq, int node)
|
||||
{
|
||||
struct irq_desc *desc;
|
||||
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)
|
|||
/*
|
||||
* alloc irq desc if not allocated already.
|
||||
*/
|
||||
desc = irq_to_desc_alloc_cpu(irq, cpu);
|
||||
desc = irq_to_desc_alloc_node(irq, node);
|
||||
if (!desc) {
|
||||
printk(KERN_INFO "can not get irq_desc for %d\n", irq);
|
||||
return NULL;
|
||||
|
|
@ -65,14 +62,14 @@ static struct irq_2_iommu *irq_2_iommu_alloc_cpu(unsigned int irq, int cpu)
|
|||
irq_iommu = desc->irq_2_iommu;
|
||||
|
||||
if (!irq_iommu)
|
||||
desc->irq_2_iommu = get_one_free_irq_2_iommu(cpu);
|
||||
desc->irq_2_iommu = get_one_free_irq_2_iommu(node);
|
||||
|
||||
return desc->irq_2_iommu;
|
||||
}
|
||||
|
||||
static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq)
|
||||
{
|
||||
return irq_2_iommu_alloc_cpu(irq, boot_cpu_id);
|
||||
return irq_2_iommu_alloc_node(irq, cpu_to_node(boot_cpu_id));
|
||||
}
|
||||
|
||||
#else /* !CONFIG_SPARSE_IRQ */
|
||||
|
|
|
|||
Loading…
Reference in a new issue