From: Keith Mannthey <kmannth@us.ibm.com>
To: Andrew Morton <akpm@digeo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC] clustered apic irq affinity fix for i386
Date: 30 Apr 2003 18:05:55 -0700 [thread overview]
Message-ID: <1051751157.16886.91.camel@dyn9-47-17-180.beaverton.ibm.com> (raw)
In-Reply-To: <20030430163637.04f06ba6.akpm@digeo.com>
> You stand accused of crimes against whitespace.
Yea I guess a little :).
> Could you please take a look at all that and resend?
This should be better. Thanks for the comments.
Keith
diff -urN linux-2.5.68/arch/i386/kernel/io_apic.c linux-2.5.68-irqfix/arch/i386/kernel/io_apic.c
--- linux-2.5.68/arch/i386/kernel/io_apic.c Sat Apr 19 19:49:09 2003
+++ linux-2.5.68-irqfix/arch/i386/kernel/io_apic.c Thu May 1 21:40:32 2003
@@ -240,29 +240,6 @@
clear_IO_APIC_pin(apic, pin);
}
-static void set_ioapic_affinity (unsigned int irq, unsigned long mask)
-{
- unsigned long flags;
- int pin;
- struct irq_pin_list *entry = irq_2_pin + irq;
-
- /*
- * Only the first 8 bits are valid.
- */
- mask = mask << 24;
- spin_lock_irqsave(&ioapic_lock, flags);
- for (;;) {
- pin = entry->pin;
- if (pin == -1)
- break;
- io_apic_write(entry->apic, 0x10 + 1 + pin*2, mask);
- if (!entry->next)
- break;
- entry = irq_2_pin + entry->next;
- }
- spin_unlock_irqrestore(&ioapic_lock, flags);
-}
-
#if defined(CONFIG_SMP)
# include <asm/processor.h> /* kernel_thread() */
# include <linux/kernel_stat.h> /* kstat */
@@ -671,6 +648,25 @@
static inline void move_irq(int irq) { }
#endif /* defined(CONFIG_SMP) */
+static void set_ioapic_affinity (unsigned int irq, unsigned long mask)
+{
+ unsigned long flags;
+ int pin;
+ struct irq_pin_list *entry = irq_2_pin + irq;
+
+ spin_lock_irqsave(&ioapic_lock, flags);
+ for (;;) {
+ pin = entry->pin;
+ if (pin == -1)
+ break;
+ io_apic_write_affinity(entry->apic, 0x10 + 1 + pin*2, mask,irq);
+ if (!entry->next)
+ break;
+ entry = irq_2_pin + entry->next;
+ }
+ spin_unlock_irqrestore(&ioapic_lock, flags);
+}
+
/*
* support for broken MP BIOSs, enables hand-redirection of PIRQ0-7 to
@@ -822,6 +818,7 @@
if (irq_entry == -1)
continue;
irq = pin_2_irq(irq_entry, ioapic, pin);
+ pending_irq_balance_apicid[irq] = mask;
set_ioapic_affinity(irq, mask);
}
diff -urN linux-2.5.68/include/asm-i386/mach-bigsmp/mach_apic.h linux-2.5.68-irqfix/include/asm-i386/mach-bigsmp/mach_apic.h
--- linux-2.5.68/include/asm-i386/mach-bigsmp/mach_apic.h Sat Apr 19 19:51:08 2003
+++ linux-2.5.68-irqfix/include/asm-i386/mach-bigsmp/mach_apic.h Thu May 1 21:22:35 2003
@@ -115,4 +115,26 @@
return (1);
}
+extern int __cacheline_aligned pending_irq_balance_apicid[];
+extern int irqbalance_disabled;
+/*
+ * We want to be careful what we write we are in clustered mode
+ * if the mask came from pending_irq_balance_apicid we are ok because
+ * it was generated with cpu_to_logical_apicid
+ */
+static inline void io_apic_write_affinity(unsigned int apic,
+ unsigned int reg, unsigned int mask, unsigned int irq)
+{
+ if ((pending_irq_balance_apicid[irq] == mask) || irqbalance_disabled) {
+ mask = mask << 24;
+ io_apic_write(apic,reg,mask);
+ } else {
+ /*
+ * You are in clustered apic mode don't write arbitrary affinity
+ * values to the apic with irqbalancing enabled
+ */
+ BUG();
+ }
+}
+
#endif /* __ASM_MACH_APIC_H */
diff -urN linux-2.5.68/include/asm-i386/mach-default/mach_apic.h linux-2.5.68-irqfix/include/asm-i386/mach-default/mach_apic.h
--- linux-2.5.68/include/asm-i386/mach-default/mach_apic.h Sat Apr 19 19:51:19 2003
+++ linux-2.5.68-irqfix/include/asm-i386/mach-default/mach_apic.h Thu May 1 21:38:34 2003
@@ -99,4 +99,12 @@
return test_bit(boot_cpu_physical_apicid, &phys_cpu_present_map);
}
+static inline void io_apic_write_affinity(unsigned int apic,
+ unsigned int reg, unsigned int mask,int irq)
+{
+ /* Only the first 8 bits are valid */
+ mask = mask << 24;
+ io_apic_write(apic,reg,mask);
+}
+
#endif /* __ASM_MACH_APIC_H */
diff -urN linux-2.5.68/include/asm-i386/mach-numaq/mach_apic.h linux-2.5.68-irqfix/include/asm-i386/mach-numaq/mach_apic.h
--- linux-2.5.68/include/asm-i386/mach-numaq/mach_apic.h Sat Apr 19 19:49:17 2003
+++ linux-2.5.68-irqfix/include/asm-i386/mach-numaq/mach_apic.h Thu May 1 21:18:25 2003
@@ -103,4 +103,26 @@
return (1);
}
+extern int __cacheline_aligned pending_irq_balance_apicid[];
+extern int irqbalance_disabled;
+/*
+ * We want to be careful what we write we are in clustered mode
+ * if the mask came from pending_irq_balance_apicid we are ok because
+ * it was generated with cpu_to_logical_apicid
+ */
+static inline void io_apic_write_affinity(unsigned int apic,
+ unsigned int reg, unsigned int mask, unsigned int irq)
+{
+ if ((pending_irq_balance_apicid[irq] == mask) || irqbalance_disabled) {
+ mask = mask << 24;
+ io_apic_write(apic,reg,mask);
+ } else {
+ /*
+ * You are in clustered apic mode don't write arbitrary affinity
+ * values to the apic with irqbalancing enabled
+ */
+ BUG();
+ }
+}
+
#endif /* __ASM_MACH_APIC_H */
diff -urN linux-2.5.68/include/asm-i386/mach-summit/mach_apic.h linux-2.5.68-irqfix/include/asm-i386/mach-summit/mach_apic.h
--- linux-2.5.68/include/asm-i386/mach-summit/mach_apic.h Sat Apr 19 19:50:06 2003
+++ linux-2.5.68-irqfix/include/asm-i386/mach-summit/mach_apic.h Thu May 1 21:19:53 2003
@@ -113,4 +113,27 @@
return test_bit(boot_cpu_physical_apicid, &phys_cpu_present_map);
}
+
+extern int __cacheline_aligned pending_irq_balance_apicid[];
+extern int irqbalance_disabled;
+/*
+ * We want to be careful what we write we are in clustered mode
+ * if the mask came from pending_irq_balance_apicid we are ok because
+ * it was generated with cpu_to_logical_apicid
+ */
+static inline void io_apic_write_affinity(unsigned int apic,
+ unsigned int reg, unsigned int mask, unsigned int irq)
+{
+ if ((pending_irq_balance_apicid[irq] == mask) || irqbalance_disabled) {
+ mask = mask << 24;
+ io_apic_write(apic,reg,mask);
+ } else {
+ /*
+ * You are in clustered apic mode don't write arbitrary affinity
+ * values to the apic with irqbalancing enabled
+ */
+ BUG();
+ }
+}
+
#endif /* __ASM_MACH_APIC_H */
diff -urN linux-2.5.68/include/asm-i386/mach-visws/mach_apic.h linux-2.5.68-irqfix/include/asm-i386/mach-visws/mach_apic.h
--- linux-2.5.68/include/asm-i386/mach-visws/mach_apic.h Sat Apr 19 19:48:49 2003
+++ linux-2.5.68-irqfix/include/asm-i386/mach-visws/mach_apic.h Thu May 1 21:39:00 2003
@@ -77,4 +77,12 @@
return test_bit(boot_cpu_physical_apicid, &phys_cpu_present_map);
}
+static inline void io_apic_write_affinity(unsigned int apic,
+ unsigned int reg, unsigned int mask, int irq)
+{
+ /* Only the first 8 bits are valid */
+ mask = mask << 24;
+ io_apic_write(apic,reg,mask);
+}
+
#endif /* __ASM_MACH_APIC_H */
next prev parent reply other threads:[~2003-05-01 0:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-30 23:07 [RFC] clustered apic irq affinity fix for i386 Keith Mannthey
2003-04-30 23:36 ` Andrew Morton
2003-05-01 1:05 ` Keith Mannthey [this message]
2003-05-01 2:22 ` Andrew Morton
2003-05-01 2:49 ` William Lee Irwin III
2003-05-01 4:07 ` Martin J. Bligh
2003-05-01 17:51 ` Keith Mannthey
2003-05-06 0:04 ` [RFC][PATCH] fix for clusterd io_apics Keith Mannthey
2003-05-06 15:15 ` Martin J. Bligh
2003-05-01 9:10 ` [RFC] clustered apic irq affinity fix for i386 Arjan van de Ven
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=1051751157.16886.91.camel@dyn9-47-17-180.beaverton.ibm.com \
--to=kmannth@us.ibm.com \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).