summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2020-01-13 09:51:53 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2020-01-13 09:51:53 +0000
commit9e18cab545e7eb872d81fe6ec471494ec509f9fb (patch)
tree188cfbcec091ef060470a80ec0e15a1b5e704e31 /sys/kern
parent1be2c81eff1b65160ca8e8b1b64fa9b9f0fd0b8f (diff)
Raise ipl of the softclock thread to IPL_SOFTCLOCK.
This prevent the soft-interrupt to run in-between of timeouts executed in a thread context. ok kettenis@, visa@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_timeout.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c
index 037ed311051..39523479ce5 100644
--- a/sys/kern/kern_timeout.c
+++ b/sys/kern/kern_timeout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_timeout.c,v 1.70 2020/01/03 20:11:11 cheloha Exp $ */
+/* $OpenBSD: kern_timeout.c,v 1.71 2020/01/13 09:51:52 mpi Exp $ */
/*
* Copyright (c) 2001 Thomas Nordin <nordin@openbsd.org>
* Copyright (c) 2000-2001 Artur Grabowski <art@openbsd.org>
@@ -554,6 +554,7 @@ softclock_thread(void *arg)
struct cpu_info *ci;
struct sleep_state sls;
struct timeout *to;
+ int s;
KERNEL_ASSERT_LOCKED();
@@ -565,6 +566,7 @@ softclock_thread(void *arg)
KASSERT(ci != NULL);
sched_peg_curproc(ci);
+ s = splsoftclock();
for (;;) {
sleep_setup(&sls, &timeout_proc, PSWP, "bored");
sleep_finish(&sls, CIRCQ_EMPTY(&timeout_proc));
@@ -579,6 +581,7 @@ softclock_thread(void *arg)
tostat.tos_thread_wakeups++;
mtx_leave(&timeout_mutex);
}
+ splx(s);
}
#ifndef SMALL_KERNEL