From: ebiederm@xmission.com (Eric W. Biederman)
To: Andi Kleen <ak@suse.de>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>,
Yinghai Lu <yinghai.lu@amd.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>
Subject: [PATCH 1/2] x86_64 irq: Simplify the vector allocator.
Date: Sun, 22 Oct 2006 22:32:07 -0600 [thread overview]
Message-ID: <m1ods3y7nc.fsf_-_@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20061022085216.GQ5211@rhun.haifa.ibm.com> (Muli Ben-Yehuda's message of "Sun, 22 Oct 2006 10:52:16 +0200")
There is no reason to remember a per cpu position of which vector
to try. Keeping a global position is simpler and more likely to
result in a global vector allocation even if I don't need or require
it. For level triggered interrupts this means we are less likely to
acknowledge another cpus irq, and cause the level triggered irq to
harmlessly refire.
This simplification makes it easier to only access data structures
of online cpus, by having fewer special cases to deal with.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
arch/x86_64/kernel/io_apic.c | 20 +++++++-------------
1 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index b000017..0e89ae7 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -612,10 +612,7 @@ static int __assign_irq_vector(int irq,
* Also, we've got to be careful not to trash gate
* 0x80, because int 0x80 is hm, kind of importantish. ;)
*/
- static struct {
- int vector;
- int offset;
- } pos[NR_CPUS] = { [ 0 ... NR_CPUS - 1] = {FIRST_DEVICE_VECTOR, 0} };
+ static int current_vector = FIRST_DEVICE_VECTOR, current_offset = 0;
int old_vector = -1;
int cpu;
@@ -631,14 +628,13 @@ static int __assign_irq_vector(int irq,
for_each_cpu_mask(cpu, mask) {
cpumask_t domain;
- int first, new_cpu;
+ int new_cpu;
int vector, offset;
domain = vector_allocation_domain(cpu);
- first = first_cpu(domain);
- vector = pos[first].vector;
- offset = pos[first].offset;
+ vector = current_vector;
+ offset = current_offset;
next:
vector += 8;
if (vector >= FIRST_SYSTEM_VECTOR) {
@@ -646,7 +642,7 @@ next:
offset = (offset + 1) % 8;
vector = FIRST_DEVICE_VECTOR + offset;
}
- if (unlikely(pos[first].vector == vector))
+ if (unlikely(current_vector == vector))
continue;
if (vector == IA32_SYSCALL_VECTOR)
goto next;
@@ -654,10 +650,8 @@ next:
if (per_cpu(vector_irq, new_cpu)[vector] != -1)
goto next;
/* Found one! */
- for_each_cpu_mask(new_cpu, domain) {
- pos[new_cpu].vector = vector;
- pos[new_cpu].offset = offset;
- }
+ current_vector = vector;
+ current_offset = offset;
if (old_vector >= 0) {
int old_cpu;
for_each_cpu_mask(old_cpu, irq_domain[irq])
--
1.4.2.rc3.g7e18e-dirty
next prev parent reply other threads:[~2006-10-23 4:34 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200610212100.k9LL0GtC018787@hera.kernel.org>
2006-10-22 3:51 ` [PATCH] x86-64: typo in __assign_irq_vector when updating pos for vector and offset Muli Ben-Yehuda
2006-10-22 5:13 ` Yinghai Lu
2006-10-22 6:55 ` yhlu
2006-10-22 8:50 ` Muli Ben-Yehuda
2006-10-22 8:50 ` Eric W. Biederman
2006-10-22 8:28 ` Yinghai Lu
2006-10-22 8:50 ` Muli Ben-Yehuda
2006-10-22 8:58 ` Eric W. Biederman
2006-10-22 16:02 ` yhlu
2006-10-22 16:19 ` yhlu
2006-10-22 21:33 ` Andi Kleen
2006-10-22 16:20 ` Muli Ben-Yehuda
2006-10-22 16:28 ` yhlu
2006-10-22 8:35 ` Eric W. Biederman
2006-10-22 8:52 ` Muli Ben-Yehuda
2006-10-22 9:10 ` Eric W. Biederman
2006-10-23 4:32 ` Eric W. Biederman [this message]
2006-10-23 4:35 ` [PATCH 2/2] x86_64 irq: Only look at per_cpu data for online cpus Eric W. Biederman
2006-10-23 6:17 ` yhlu
2006-10-23 8:14 ` Muli Ben-Yehuda
2006-10-23 6:15 ` [PATCH 1/2] x86_64 irq: Simplify the vector allocator yhlu
2006-10-24 5:29 ` Andi Kleen
2006-10-22 13:29 ` [PATCH] x86-64: typo in __assign_irq_vector when updating pos for vector and offset Andi Kleen
2006-10-22 16:31 ` 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=m1ods3y7nc.fsf_-_@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=muli@il.ibm.com \
--cc=yinghai.lu@amd.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
Powered by JetHome