public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH] x86_64 irq: reset more to default when clear irq_vector for destroy_irq
@ 2006-10-25 16:40 Lu, Yinghai
  2006-10-27  6:20 ` Eric W. Biederman
  0 siblings, 1 reply; 13+ messages in thread
From: Lu, Yinghai @ 2006-10-25 16:40 UTC (permalink / raw)
  To: Muli Ben-Yehuda
  Cc: Andi Kleen, Eric W. Biederman, Andrew Morton,
	Linux Kernel Mailing List

Thanks.

I only found ht_irq and msi call destroy_irq. How about io_apic? 

YH

-----Original Message-----
From: Muli Ben-Yehuda [mailto:muli@il.ibm.com] 
Sent: Wednesday, October 25, 2006 4:30 AM
To: Lu, Yinghai
Cc: Andi Kleen; Eric W. Biederman; Andrew Morton; Linux Kernel Mailing
List
Subject: Re: [PATCH] x86_64 irq: reset more to default when clear
irq_vector for destroy_irq

On Tue, Oct 24, 2006 at 08:46:31PM -0700, Yinghai Lu wrote:
> resend with gmail.
> 
> 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>
> Signed-off-By: Yinghai Lu <yinghai.lu@amd.com>

I hope I'm testing the right patch... this one boots and works fine.

Cheers,
Muli





^ permalink raw reply	[flat|nested] 13+ messages in thread
* [PATCH] x86_64 irq: reset more to default when clear irq_vector for destroy_irq
@ 2006-10-24 21:33 Lu, Yinghai
  2006-10-24 22:52 ` Josef Sipek
  2006-10-25  3:46 ` Yinghai Lu
  0 siblings, 2 replies; 13+ messages in thread
From: Lu, Yinghai @ 2006-10-24 21:33 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Eric W. Biederman, Muli Ben-Yehuda, Andrew Morton,
	Linux Kernel Mailing List

 
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 get that vector.

Signed-off-By: Yinghai Lu <yinghai.lu@amd.com>

--- linux-2.6/arch/x86_64/kernel/io_apic.c	2006-10-24
13:40:48.000000000 -0700
+++ linux-2.6.xx/arch/x86_64/kernel/io_apic.c	2006-10-24
14:03:08.000000000 -0700
@@ -716,6 +716,22 @@
 	return vector;
 }
 
+static void __clear_irq_vector(int irq)
+{
+	int old_vector = -1;
+	if (irq_vector[irq] > 0)
+		old_vector = irq_vector[irq];
+	if (old_vector >= 0) {
+		cpumask_t old_mask;
+		int old_cpu;
+		cpus_and(old_mask, irq_domain[irq], cpu_online_map);
+		for_each_cpu_mask(old_cpu, old_mask)
+			per_cpu(vector_irq, old_cpu)[old_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 */
@@ -1803,7 +1819,7 @@
 	dynamic_irq_cleanup(irq);
 
 	spin_lock_irqsave(&vector_lock, flags);
-	irq_vector[irq] = 0;
+	__clear_irq_vector(irq);
 	spin_unlock_irqrestore(&vector_lock, flags);
 }
 



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2006-10-28 20:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-25 16:40 [PATCH] x86_64 irq: reset more to default when clear irq_vector for destroy_irq Lu, Yinghai
2006-10-27  6:20 ` Eric W. Biederman
2006-10-28  5:44   ` Yinghai Lu
2006-10-28  9:18     ` Oleg Verych
2006-10-28 17:29     ` Andi Kleen
2006-10-28 20:06       ` Eric W. Biederman
  -- strict thread matches above, loose matches on Subject: below --
2006-10-24 21:33 Lu, Yinghai
2006-10-24 22:52 ` Josef Sipek
2006-10-25  3:46 ` Yinghai Lu
2006-10-25  4:02   ` Yinghai Lu
2006-10-25  4:52   ` David Rientjes
2006-10-25  6:01     ` yhlu
2006-10-25 11:30   ` Muli Ben-Yehuda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox