summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>2005-05-25 23:17:48 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>2005-05-25 23:17:48 +0000
commitd6ec0bc1862a4fed11c7f4ac537413b2c7e89de4 (patch)
tree6c1ed544e4a8e11ea3e107d10a95bad1273dc5a4 /sys/arch/i386
parentfee642f79221488ebcacbd0ca219a563c8607281 (diff)
This patch is mortly art's work and was done *a year* ago. Art wants to thank
everyone for the prompt review and ok of this work ;-) Yeah, that includes me too, or maybe especially me. I am sorry. Change the sched_lock to a mutex. This fixes, among other things, the infamous "telnet localhost &" problem. The real bug in that case was that the sched_lock which is by design a non-recursive lock, was recursively acquired, and not enough releases made us hold the lock in the idle loop, blocking scheduling on the other processors. Some of the other processors would hold the biglock though, which made it impossible for cpu 0 to enter the kernel... A nice deadlock. Let me just say debugging this for days just to realize that it was all fixed in an old diff noone ever ok'd was somewhat of an anti-climax. This diff also changes splsched to be correct for all our architectures.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/locore.s3
-rw-r--r--sys/arch/i386/i386/trap.c11
-rw-r--r--sys/arch/i386/include/intrdefs.h4
3 files changed, 4 insertions, 14 deletions
diff --git a/sys/arch/i386/i386/locore.s b/sys/arch/i386/i386/locore.s
index a067a9b3ca9..df652a97c19 100644
--- a/sys/arch/i386/i386/locore.s
+++ b/sys/arch/i386/i386/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.87 2005/05/25 22:50:25 beck Exp $ */
+/* $OpenBSD: locore.s,v 1.88 2005/05/25 23:17:47 niklas Exp $ */
/* $NetBSD: locore.s,v 1.145 1996/05/03 19:41:19 christos Exp $ */
/*-
@@ -1616,7 +1616,6 @@ ENTRY(idle_loop)
jmp _C_LABEL(idle_loop)
ENTRY(idle_exit)
- movl $IPL_HIGH,CPL # splhigh
sti
#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG)
call _C_LABEL(sched_lock_idle)
diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c
index e0aeb203bfb..98d21021725 100644
--- a/sys/arch/i386/i386/trap.c
+++ b/sys/arch/i386/i386/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.67 2004/12/06 20:12:24 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.68 2005/05/25 23:17:47 niklas Exp $ */
/* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */
/*-
@@ -451,15 +451,6 @@ trap(frame)
case T_PAGEFLT: /* allow page faults in kernel mode */
if (p == 0 || p->p_addr == 0)
goto we_re_toast;
-#ifdef LOCKDEBUG
- /* If we page-fault while in scheduler, we're doomed. */
-#ifdef notyet
- if (simple_lock_held(&sched_lock))
-#else
- if (__mp_lock_held(&sched_lock))
-#endif
- goto we_re_toast;
-#endif
pcb = &p->p_addr->u_pcb;
#if 0
diff --git a/sys/arch/i386/include/intrdefs.h b/sys/arch/i386/include/intrdefs.h
index c2c998b76b3..2cf218fc765 100644
--- a/sys/arch/i386/include/intrdefs.h
+++ b/sys/arch/i386/include/intrdefs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intrdefs.h,v 1.2 2004/06/13 21:49:16 niklas Exp $ */
+/* $OpenBSD: intrdefs.h,v 1.3 2005/05/25 23:17:47 niklas Exp $ */
/* $NetBSD: intrdefs.h,v 1.2 2003/05/04 22:01:56 fvdl Exp $ */
#ifndef _i386_INTRDEFS_H
@@ -66,8 +66,8 @@
#define IPL_IMP IPL_VM /* XXX - should not be here. */
#define IPL_AUDIO MAKEIPL(7) /* audio */
#define IPL_CLOCK MAKEIPL(8) /* clock */
-#define IPL_SCHED IPL_CLOCK
#define IPL_STATCLOCK MAKEIPL(9) /* statclock */
+#define IPL_SCHED IPL_STATCLOCK
#define IPL_HIGH MAKEIPL(9) /* everything */
#define IPL_IPI MAKEIPL(10) /* interprocessor interrupt */