From: "Martin J. Bligh" <mbligh@aracnet.com>
To: Mark Haverkamp <markh@osdl.org>, haveblue@us.ibm.com
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: 2.5.59-mjb3 (scalability / NUMA patchset)
Date: Tue, 04 Feb 2003 00:59:42 -0800 [thread overview]
Message-ID: <169790000.1044349175@[10.10.2.4]> (raw)
In-Reply-To: <1044298502.29532.8.camel@markh1.pdx.osdl.net>
[-- Attachment #1: Type: text/plain, Size: 604 bytes --]
>> > I tried 2.5.59-mjb3 today on our 16 processor numaq and got a boot
>> > hang. I had been running 2.5.59-mjb2 previously. I have included the
>> > console output and my config file.
>>
>> What gcc are you using? I'm betting 3.2 ... 2.95 seems to work fine.
>
> You are right, I am using:
>
> gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
>
>> (still might be an issue with the patch, just trying to track it down)
OK, it's the attatched patch's fault. Can you patch -R it, and confirm that
fixes it? (does for me).
Dave, can you take a look at why this breaks with gcc 3.2?
Thanks,
M.
[-- Attachment #2: B1-irqstackfix-2.5.59-mjb1-0.txt --]
[-- Type: text/plain, Size: 8550 bytes --]
diff -ur linux-2.5.59-mjb1/arch/i386/Kconfig linux-2.5.59-numaq-mjb1/arch/i386/Kconfig
--- linux-2.5.59-mjb1/arch/i386/Kconfig Sun Jan 26 23:16:19 2003
+++ linux-2.5.59-numaq-mjb1/arch/i386/Kconfig Mon Jan 27 10:59:46 2003
@@ -363,6 +363,11 @@
depends on MK8 || MPENTIUM4
default y
+config X86_CMOV
+ bool
+ depends on M686 || MPENTIUMII || MPENTIUMIII || MPENTIUM4 || MK8 || MCRUSOE
+ default y
+
config HUGETLB_PAGE
bool "Huge TLB Page Support"
help
diff -ur linux-2.5.59-mjb1/arch/i386/kernel/apic.c linux-2.5.59-numaq-mjb1/arch/i386/kernel/apic.c
--- linux-2.5.59-mjb1/arch/i386/kernel/apic.c Sun Jan 26 23:14:51 2003
+++ linux-2.5.59-numaq-mjb1/arch/i386/kernel/apic.c Sun Jan 26 14:23:22 2003
@@ -1038,7 +1038,8 @@
* interrupt as well. Thus we cannot inline the local irq ... ]
*/
-void smp_apic_timer_interrupt(struct pt_regs regs)
+struct pt_regs * smp_apic_timer_interrupt(struct pt_regs* regs) __attribute__((regparm(1)));
+struct pt_regs * smp_apic_timer_interrupt(struct pt_regs* regs)
{
int cpu = smp_processor_id();
@@ -1058,14 +1059,16 @@
* interrupt lock, which is the WrongThing (tm) to do.
*/
irq_enter();
- smp_local_timer_interrupt(®s);
+ smp_local_timer_interrupt(regs);
irq_exit();
+ return regs;
}
/*
* This interrupt should _never_ happen with our APIC/SMP architecture
*/
-asmlinkage void smp_spurious_interrupt(void)
+struct pt_regs * smp_spurious_interrupt(struct pt_regs* regs) __attribute__((regparm(1)));
+struct pt_regs * smp_spurious_interrupt(struct pt_regs* regs)
{
unsigned long v;
@@ -1083,13 +1086,15 @@
printk(KERN_INFO "spurious APIC interrupt on CPU#%d, should never happen.\n",
smp_processor_id());
irq_exit();
+ return regs;
}
/*
* This interrupt should never happen with our APIC/SMP architecture
*/
-asmlinkage void smp_error_interrupt(void)
+struct pt_regs * smp_error_interrupt(struct pt_regs* regs) __attribute__((regparm(1)));
+struct pt_regs * smp_error_interrupt(struct pt_regs* regs)
{
unsigned long v, v1;
@@ -1114,6 +1119,7 @@
printk (KERN_INFO "APIC error on CPU%d: %02lx(%02lx)\n",
smp_processor_id(), v , v1);
irq_exit();
+ return regs;
}
/*
diff -ur linux-2.5.59-mjb1/arch/i386/kernel/cpu/mcheck/p4.c linux-2.5.59-numaq-mjb1/arch/i386/kernel/cpu/mcheck/p4.c
--- linux-2.5.59-mjb1/arch/i386/kernel/cpu/mcheck/p4.c Sun Jan 26 23:14:51 2003
+++ linux-2.5.59-numaq-mjb1/arch/i386/kernel/cpu/mcheck/p4.c Sun Jan 26 23:23:08 2003
@@ -61,7 +61,8 @@
/* Thermal interrupt handler for this CPU setup */
static void (*vendor_thermal_interrupt)(struct pt_regs *regs) = unexpected_thermal_interrupt;
-asmlinkage void smp_thermal_interrupt(struct pt_regs regs)
+asmlinkage struct pt_regs * smp_thermal_interrupt(struct pt_regs *regs) __attribute__((regparm(1)));
+struct pt_regs* smp_thermal_interrupt(struct pt_regs* regs)
{
irq_enter();
vendor_thermal_interrupt(®s);
diff -ur linux-2.5.59-mjb1/arch/i386/kernel/entry.S linux-2.5.59-numaq-mjb1/arch/i386/kernel/entry.S
--- linux-2.5.59-mjb1/arch/i386/kernel/entry.S Sun Jan 26 23:16:19 2003
+++ linux-2.5.59-numaq-mjb1/arch/i386/kernel/entry.S Mon Jan 27 11:14:08 2003
@@ -138,8 +138,6 @@
.long 1b,2b; \
.previous
-
-
ENTRY(lcall7)
pushfl # We get a different stack layout with call
# gates, which has to be cleaned up later..
@@ -388,55 +386,76 @@
vector=vector+1
.endr
- ALIGN
-common_interrupt:
- SAVE_ALL
-
- GET_THREAD_INFO(%ebx)
- movl TI_IRQ_STACK(%ebx),%ecx
- movl TI_TASK(%ebx),%edx
- movl %esp,%eax
- leal (THREAD_SIZE-4)(%ecx),%esi # %ecx+THREAD_SIZE is next stack
- # -4 keeps us in the right one
- testl %ecx,%ecx # is there a valid irq_stack?
-
- # switch to the irq stack
-#ifdef CONFIG_X86_HAVE_CMOV
- cmovnz %esi,%esp
+# lets play optimizing compiler...
+#ifdef CONFIG_X86_CMOV
+#define COND_MOVE cmovnz %esi,%esp;
#else
- jz 1f
- mov %esi,%esp
+#define COND_MOVE \
+ jz 1f; \
+ mov %esi,%esp; \
1:
#endif
-
- # update the task pointer in the irq stack
- GET_THREAD_INFO(%esi)
- movl %edx,TI_TASK(%esi)
-
- # update the preempt count in the irq stack
- movl TI_PRE_COUNT(%ebx),%ecx
- movl %ecx,TI_PRE_COUNT(%esi)
-
- call do_IRQ
- movl %eax,%esp # potentially restore non-irq stack
-
- # copy flags from the irq stack back into the task's thread_info
- # %esi is saved over the do_IRQ call and contains the irq stack
- # thread_info pointer
- # %ebx contains the original thread_info pointer
- movl TI_FLAGS(%esi),%eax
- movl $0,TI_FLAGS(%esi)
- LOCK orl %eax,TI_FLAGS(%ebx)
+# These macros will switch you to, and from a per-cpu interrupt stack
+# They take the pt_regs arg and move it from the normal place on the
+# stack to %eax. Any handler function can retrieve it using regparm(1).
+# The handlers are expected to return the stack to switch back to in
+# the same register.
+#
+# This means that the irq handlers need to return their arg
+#
+# SWITCH_TO_IRQSTACK clobbers %ebx, %ecx, %edx, %esi
+# old stack in %eax
+
+#define SWITCH_TO_IRQSTACK \
+ GET_THREAD_INFO(%ebx); \
+ movl TI_IRQ_STACK(%ebx),%ecx; \
+ movl TI_TASK(%ebx),%edx; \
+ movl %esp,%eax; \
+ \
+ /* %ecx+THREAD_SIZE is next stack -4 keeps us in the right one */ \
+ leal (THREAD_SIZE-4)(%ecx),%esi; \
+ \
+ /* is there a valid irq_stack? */ \
+ testl %ecx,%ecx; \
+ COND_MOVE; \
+ \
+ /* update the task pointer in the irq stack */ \
+ GET_THREAD_INFO(%esi); \
+ movl %edx,TI_TASK(%esi); \
+ \
+ /* update the preempt count in the irq stack */ \
+ movl TI_PRE_COUNT(%ebx),%ecx; \
+ movl %ecx,TI_PRE_COUNT(%esi);
+
+# copy flags from the irq stack back into the task's thread_info
+# %esi is saved over the irq handler call and contains the irq stack
+# thread_info pointer
+# %eax was returned from the handler, as described above
+# %ebx contains the original thread_info pointer
+
+#define RESTORE_FROM_IRQSTACK \
+ movl %eax,%esp; \
+ movl TI_FLAGS(%esi),%eax; \
+ movl $0,TI_FLAGS(%esi); \
+ LOCK orl %eax,TI_FLAGS(%ebx);
+ ALIGN
+common_interrupt:
+ SAVE_ALL
+ SWITCH_TO_IRQSTACK
+ call do_IRQ
+ RESTORE_FROM_IRQSTACK
jmp ret_from_intr
#define BUILD_INTERRUPT(name, nr) \
ENTRY(name) \
- pushl $nr-256; \
+ pushl $nr-256; \
SAVE_ALL \
- call smp_/**/name; \
+ SWITCH_TO_IRQSTACK \
+ call smp_/**/name; \
+ RESTORE_FROM_IRQSTACK \
jmp ret_from_intr;
/* The include is where all of the SMP etc. interrupts come from */
diff -ur linux-2.5.59-mjb1/arch/i386/kernel/smp.c linux-2.5.59-numaq-mjb1/arch/i386/kernel/smp.c
--- linux-2.5.59-mjb1/arch/i386/kernel/smp.c Sun Jan 26 23:16:19 2003
+++ linux-2.5.59-numaq-mjb1/arch/i386/kernel/smp.c Sun Jan 26 14:37:09 2003
@@ -305,7 +305,8 @@
* 2) Leave the mm if we are in the lazy tlb mode.
*/
-asmlinkage void smp_invalidate_interrupt (void)
+struct pt_regs *smp_invalidate_interrupt(struct pt_regs *regs) __attribute__((regparm(1)));
+struct pt_regs *smp_invalidate_interrupt(struct pt_regs *regs)
{
unsigned long cpu;
@@ -336,6 +337,7 @@
out:
put_cpu_no_resched();
+ return regs;
}
static void flush_tlb_others (unsigned long cpumask, struct mm_struct *mm,
@@ -598,12 +600,17 @@
* all the work is done automatically when
* we return from the interrupt.
*/
-asmlinkage void smp_reschedule_interrupt(void)
+
+asmlinkage struct pt_regs * smp_reschedule_interrupt(struct pt_regs *regs) __attribute__((regparm(1)));
+struct pt_regs * smp_reschedule_interrupt(struct pt_regs *regs)
{
ack_APIC_irq();
+ return regs;
}
-asmlinkage void smp_call_function_interrupt(struct pt_regs regs)
+
+asmlinkage struct pt_regs * smp_call_function_interrupt(struct pt_regs *regs) __attribute__((regparm(1)));
+struct pt_regs * smp_call_function_interrupt(struct pt_regs *regs)
{
void (*func) (void *info, struct pt_regs *) = (void (*)(void *, struct pt_regs*))call_data->func;
void *info = call_data->info;
@@ -620,12 +627,13 @@
* At this point the info structure may be out of scope unless wait==1
*/
irq_enter();
- (*func)(info, ®s);
+ (*func)(info, regs);
irq_exit();
if (wait) {
mb();
atomic_inc(&call_data->finished);
}
+ return regs;
}
next prev parent reply other threads:[~2003-02-04 8:50 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-26 0:30 2.5.47-mjb3 " Martin J. Bligh
2002-12-09 6:11 ` 2.5.50-mjb1 " Martin J. Bligh
2002-12-09 9:06 ` William Lee Irwin III
2002-12-10 6:42 ` 2.5.50-mjb2 " Martin J. Bligh
2002-12-10 6:49 ` William Lee Irwin III
2002-12-17 8:10 ` 2.5.52-mjb1 " Martin J. Bligh
2002-12-17 15:57 ` William Lee Irwin III
2002-12-17 17:49 ` William Lee Irwin III
2002-12-17 19:31 ` Martin J. Bligh
2002-12-24 8:11 ` 2.5.53-mjb1 " Martin J. Bligh
2003-01-03 7:37 ` 2.5.54-mjb1 " Martin J. Bligh
2003-01-06 2:58 ` 2.5.54-mjb2 " Martin J. Bligh
2003-01-09 8:31 ` 2.5.54-mjb3 " Martin J. Bligh
2003-01-10 7:21 ` 2.5.55-mjb1 " Martin J. Bligh
2003-01-14 8:05 ` 2.5.58-mjb1 " Martin J. Bligh
2003-01-17 7:11 ` 2.5.58-mjb2 " Martin J. Bligh
2003-01-17 9:49 ` William Lee Irwin III
2003-01-17 15:44 ` Martin J. Bligh
2003-01-21 8:19 ` 2.5.59-mjb1 " Martin J. Bligh
2003-01-29 2:16 ` 2.5.59-mjb2 " Martin J. Bligh
2003-02-03 2:08 ` 2.5.59-mjb3 " Martin J. Bligh
2003-02-03 18:33 ` Mark Haverkamp
2003-02-03 18:42 ` Martin J. Bligh
2003-02-03 18:55 ` Mark Haverkamp
2003-02-03 19:03 ` Martin J. Bligh
2003-02-03 19:35 ` Mark Haverkamp
2003-02-04 8:59 ` Martin J. Bligh [this message]
2003-02-07 7:37 ` 2.5.59-mjb4 " Martin J. Bligh
2003-02-09 3:26 ` 2.5.59-mjb5 " Martin J. Bligh
2003-02-11 18:03 ` 2.5.59-mjb6 " Martin J. Bligh
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='169790000.1044349175@[10.10.2.4]' \
--to=mbligh@aracnet.com \
--cc=haveblue@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markh@osdl.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
all inboxes | Powered by JetHome®