Commit 5df0287e authored by Yinghai Lu's avatar Yinghai Lu Committed by Andi Kleen

[PATCH] x86-64: Extend clear_irq_vector

Clear the irq releated entries in irq_vector, irq_domain and vector_irq
instead of clearing irq_vector only. So when new irq is created, it
could reuse that vector. (actually is the second loop scanning from
FIRST_DEVICE_VECTOR+8). This could avoid the vectors are used up
with enough module inserting and removing

Cc: Eric W. Biedierman <ebiederm@xmission.com>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-By: default avatarYinghai Lu <yinghai.lu@amd.com>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
parent 3760dd6e
...@@ -750,6 +750,22 @@ static int assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result) ...@@ -750,6 +750,22 @@ static int assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result)
return vector; return vector;
} }
static void __clear_irq_vector(int irq)
{
cpumask_t mask;
int cpu, vector;
BUG_ON(!irq_vector[irq]);
vector = irq_vector[irq];
cpus_and(mask, irq_domain[irq], cpu_online_map);
for_each_cpu_mask(cpu, mask)
per_cpu(vector_irq, cpu)[vector] = -1;
irq_vector[irq] = 0;
irq_domain[irq] = CPU_MASK_NONE;
}
void __setup_vector_irq(int cpu) void __setup_vector_irq(int cpu)
{ {
/* Initialize vector_irq on a new cpu */ /* Initialize vector_irq on a new cpu */
...@@ -1837,7 +1853,7 @@ void destroy_irq(unsigned int irq) ...@@ -1837,7 +1853,7 @@ void destroy_irq(unsigned int irq)
dynamic_irq_cleanup(irq); dynamic_irq_cleanup(irq);
spin_lock_irqsave(&vector_lock, flags); spin_lock_irqsave(&vector_lock, flags);
irq_vector[irq] = 0; __clear_irq_vector(irq);
spin_unlock_irqrestore(&vector_lock, flags); spin_unlock_irqrestore(&vector_lock, flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment