+ x86_64-irq-reset-more-to-default-when-clear-irq_vector-for-destroy_irq.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     x86_64 irq: reset more to default when clear irq_vector for destroy_irq
has been added to the -mm tree.  Its filename is
     x86_64-irq-reset-more-to-default-when-clear-irq_vector-for-destroy_irq.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: x86_64 irq: reset more to default when clear irq_vector for destroy_irq
From: "Yinghai Lu" <yinghai.lu@xxxxxxx>

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@xxxxxxxxxxxx>
Cc: Muli Ben-Yehuda <muli@xxxxxxxxxx>
Signed-off-by: Yinghai Lu <yinghai.lu@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/x86_64/kernel/io_apic.c |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff -puN arch/x86_64/kernel/io_apic.c~x86_64-irq-reset-more-to-default-when-clear-irq_vector-for-destroy_irq arch/x86_64/kernel/io_apic.c
--- a/arch/x86_64/kernel/io_apic.c~x86_64-irq-reset-more-to-default-when-clear-irq_vector-for-destroy_irq
+++ a/arch/x86_64/kernel/io_apic.c
@@ -714,6 +714,22 @@ static int assign_irq_vector(int irq, cp
 	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)
 {
 	/* Initialize vector_irq on a new cpu */
@@ -1801,7 +1817,7 @@ void destroy_irq(unsigned int irq)
 	dynamic_irq_cleanup(irq);
 
 	spin_lock_irqsave(&vector_lock, flags);
-	irq_vector[irq] = 0;
+	__clear_irq_vector(irq);
 	spin_unlock_irqrestore(&vector_lock, flags);
 }
 
_

Patches currently in -mm which might be from yinghai.lu@xxxxxxx are

x86_64-irq-reuse-vector-for-__assign_irq_vector.patch
x86_64-irq-reset-more-to-default-when-clear-irq_vector-for-destroy_irq.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux