summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2004-03-23 22:28:16 +0000
committerjhb <jhb@FreeBSD.org>2004-03-23 22:28:16 +0000
commitc92c2d6926b1957433d010a9d32ff510b02b8fa2 (patch)
tree0faa631deca55698de0d391a5b8036cca087623e
parent14651d99f319b73e24cd4f288b91d09a2e568f84 (diff)
downloadFreeBSD-src-c92c2d6926b1957433d010a9d32ff510b02b8fa2.zip
FreeBSD-src-c92c2d6926b1957433d010a9d32ff510b02b8fa2.tar.gz
Enable interrupt preemption on Alpha. Previously, flipping this switch on
caused hangs on SMP systems under load. My theory was that an interrupted thread was migrating and returning to PAL on a different CPU and that that caused the hangs. To prevent this, I used the recently added sched_pin() API to pin the interrupted thread to the CPU that received the interrupt across ithread_schedule() to prevent migration. This seems to have fixed the hangs based on tests by several folks on the alpha@ list. Tested by: wilko, tisco, several others on alpha@
-rw-r--r--sys/alpha/alpha/interrupt.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/alpha/alpha/interrupt.c b/sys/alpha/alpha/interrupt.c
index 4bce4cd..cccf94a 100644
--- a/sys/alpha/alpha/interrupt.c
+++ b/sys/alpha/alpha/interrupt.c
@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/proc.h>
+#include <sys/sched.h>
#include <sys/smp.h>
#include <sys/unistd.h>
#include <sys/vmmeter.h>
@@ -447,8 +448,16 @@ alpha_dispatch_intr(void *frame, unsigned long vector)
"alpha_dispatch_intr: disabling vector 0x%x", i->vector);
ithd->it_disable(ithd->it_vector);
}
- error = ithread_schedule(ithd, 0 /* !cold */);
+
+ /*
+ * It seems that we need to return from an interrupt back to PAL
+ * on the same CPU that received the interrupt, so pin the interrupted
+ * thread to the current CPU until we return from the interrupt.
+ */
+ sched_pin();
+ error = ithread_schedule(ithd, !cold);
KASSERT(error == 0, ("got an impossible stray interrupt"));
+ sched_unpin();
}
static void
OpenPOWER on IntegriCloud