diff options
author | gallatin <gallatin@FreeBSD.org> | 2002-07-17 02:23:44 +0000 |
---|---|---|
committer | gallatin <gallatin@FreeBSD.org> | 2002-07-17 02:23:44 +0000 |
commit | b6368d35106f2181ca1d6536cbb3e1fab2a5b3c0 (patch) | |
tree | 5924547463c69dff00bd745cf367d4a708e9a16e /sys/kern/kern_switch.c | |
parent | 3abb526f86a27b005f352fb91f605228876fa8f7 (diff) | |
download | FreeBSD-src-b6368d35106f2181ca1d6536cbb3e1fab2a5b3c0.zip FreeBSD-src-b6368d35106f2181ca1d6536cbb3e1fab2a5b3c0.tar.gz |
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)
Diffstat (limited to 'sys/kern/kern_switch.c')
-rw-r--r-- | sys/kern/kern_switch.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 4ae03a9..9629ac2 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); } |