diff options
author | Ian Moffett <ian@osmora.org> | 2025-08-20 00:56:31 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-08-20 00:56:31 -0400 |
commit | c921000af6782a6a35da8e3b3482b3737c49ac23 (patch) | |
tree | 4a01f1d0ff8ada6b334f2bfbf8d3da733c02747c /sys/kern | |
parent | 0972694abb1fe2137eeed3c0bdfa70eb31327c8f (diff) |
kernel: exit: Panic if core is not preemptable
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_exit.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 9377eed..af697d7 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -190,6 +190,14 @@ exit1(struct proc *td, int flags) * and do not return. */ if (target_pid == curpid) { + /* + * If the thread is exiting on a core that is not + * preemptable, something is not right. + */ + if (__unlikely(!sched_preemptable())) { + panic("exit1: cpu %d not preemptable\n", ci->id); + } + ci->curtd = NULL; if (parent->pid == 0) sched_enter(); |