aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_switch.c
diff options
context:
space:
mode:
authorAndrew Gallatin <gallatin@FreeBSD.org>2002-07-17 02:23:44 +0000
committerAndrew Gallatin <gallatin@FreeBSD.org>2002-07-17 02:23:44 +0000
commitfe79953325321e0e7753af60b2baf85413702ef0 (patch)
tree5924547463c69dff00bd745cf367d4a708e9a16e /sys/kern/kern_switch.c
parentfb36a3d8472e3b7c446b5501635ec34eb1ebaa00 (diff)
downloadsrc-fe79953325321e0e7753af60b2baf85413702ef0.tar.gz
src-fe79953325321e0e7753af60b2baf85413702ef0.zip
Allow alphas to do crashdumps: Refuse to run anything in choosethread()
after a panic which is not an interrupt thread, or the thread which caused the panic. Also, remove panicstr checks from msleep() and from cv_wait() in order to allow threads to go to sleep and yeild the cpu to the panicing thread, or to an interrupt thread which might be doing the crashdump. Reviewed by: jhb (and it was mostly his idea too)
Notes
Notes: svn path=/head/; revision=100209
Diffstat (limited to 'sys/kern/kern_switch.c')
-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 4ae03a928950..9629ac241403 100644
--- a/sys/kern/kern_switch.c
+++ b/sys/kern/kern_switch.c
@@ -124,6 +124,7 @@ choosethread(void)
struct thread *td;
struct ksegrp *kg;
+retry:
if ((ke = runq_choose(&runq))) {
td = ke->ke_thread;
KASSERT((td->td_kse == ke), ("kse/thread mismatch"));
@@ -157,6 +158,9 @@ choosethread(void)
td = PCPU_GET(idlethread);
CTR1(KTR_RUNQ, "choosethread: td=%p (idle)", td);
}
+ if (panicstr && ((td->td_proc->p_flag & P_SYSTEM) == 0 &&
+ (td->td_flags & TDF_INPANIC) == 0))
+ goto retry;
td->td_state = TDS_RUNNING;
return (td);
}