mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yinghai Lu" <yinghai.lu@amd.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: "Muli Ben-Yehuda" <muli@il.ibm.com>, "Andi Kleen" <ak@muc.de>,
	"Andrew Morton" <akpm@osdl.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86_64 irq: reset more to default when clear irq_vector for destroy_irq
Date: Fri, 27 Oct 2006 22:44:36 -0700	[thread overview]
Message-ID: <86802c440610272244q750f35a7hcbed50e58546d97@mail.gmail.com> (raw)
In-Reply-To: <m1ejsuqnyf.fsf@ebiederm.dsl.xmission.com>

[-- Attachment #1: Type: text/plain, Size: 539 bytes --]

revised version according to Eric. and it can be applied clearly to
current Linus's Tree.

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: Yinghai Lu <yinghai.lu@amd.com>

[-- Attachment #2: io_apic_clear_irq_vector_1027.diff --]
[-- Type: text/x-patch, Size: 898 bytes --]

diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index fe429e5..976634c 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -684,6 +684,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 */
@@ -1771,7 +1787,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);
 }
 

  reply	other threads:[~2006-10-28  5:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-25 16:40 Lu, Yinghai
2006-10-27  6:20 ` Eric W. Biederman
2006-10-28  5:44   ` Yinghai Lu [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86802c440610272244q750f35a7hcbed50e58546d97@mail.gmail.com \
    --to=yinghai.lu@amd.com \
    --cc=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=muli@il.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®