summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2004-08-20 05:18:50 +0000
committerscottl <scottl@FreeBSD.org>2004-08-20 05:18:50 +0000
commitb336a56514b18fa6a85b32c7b2036771e3362d77 (patch)
tree1fa3b71d27147e3e39bb1aaf9f9c9d40944f7e65
parentc394cda927398ab075cbf0d89168a6346f5767cb (diff)
downloadFreeBSD-src-b336a56514b18fa6a85b32c7b2036771e3362d77.zip
FreeBSD-src-b336a56514b18fa6a85b32c7b2036771e3362d77.tar.gz
In maybe_preempt(), ignore threads that are in an inconsistent state. This
is an effective band-aid for at least some of the scheduler corruption seen recently. The real fix will involve protecting threads while they are inconsistent, and will come later. Submitted by: julian
-rw-r--r--sys/kern/kern_switch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c
index 92e229e..f2aa3e0 100644
--- a/sys/kern/kern_switch.c
+++ b/sys/kern/kern_switch.c
@@ -522,6 +522,10 @@ maybe_preempt(struct thread *td)
* to the new thread.
*/
ctd = curthread;
+
+ if ((ctd->td_kse == NULL) || (ctd->td_kse->ke_thread != ctd))
+ return (0);
+
pri = td->td_priority;
cpri = ctd->td_priority;
if (pri >= cpri || cold /* || dumping */ || TD_IS_INHIBITED(ctd) ||
OpenPOWER on IntegriCloud