diff options
| author | 2019-11-02 16:56:17 +0000 | |
|---|---|---|
| committer | 2019-11-02 16:56:17 +0000 | |
| commit | 8fe879fb5c20bee4c0ed88c65c92e69c6daf7d31 (patch) | |
| tree | 7d99cd5e92640b6a559ca826692fa29a05a30f3b /sys/kern/kern_clock.c | |
| parent | Revert previous, a race is present and can be triggered with golang. (diff) | |
| download | wireguard-openbsd-8fe879fb5c20bee4c0ed88c65c92e69c6daf7d31.tar.xz wireguard-openbsd-8fe879fb5c20bee4c0ed88c65c92e69c6daf7d31.zip | |
softclock: move softintr registration/scheduling into timeout module
softclock() is scheduled from hardclock(9) because long ago callouts were
processed from hardclock(9) directly. The introduction of timeout(9) circa
2000 moved all callout processing into a dedicated module, but the softclock
scheduling stayed behind in hardclock(9).
We can move all the softclock() "stuff" into the timeout module to make
kern_clock.c a bit cleaner. Neither initclocks() nor hardclock(9) need
to "know" about softclock(). The initial softclock() softintr registration
can be done from timeout_proc_init() and softclock() can be scheduled
from timeout_hardclock_update().
ok visa@
Diffstat (limited to 'sys/kern/kern_clock.c')
| -rw-r--r-- | sys/kern/kern_clock.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index edaf8cdec61..0a3679b0510 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_clock.c,v 1.99 2019/08/02 02:17:35 cheloha Exp $ */ +/* $OpenBSD: kern_clock.c,v 1.100 2019/11/02 16:56:17 cheloha Exp $ */ /* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */ /*- @@ -87,8 +87,6 @@ int ticks; static int psdiv, pscnt; /* prof => stat divider */ int psratio; /* ratio: prof / stat */ -void *softclock_si; - volatile unsigned long jiffies; /* XXX Linux API for drm(4) */ /* @@ -99,10 +97,6 @@ initclocks(void) { int i; - softclock_si = softintr_establish(IPL_SOFTCLOCK, softclock, NULL); - if (softclock_si == NULL) - panic("initclocks: unable to register softclock intr"); - ticks = INT_MAX - (15 * 60 * hz); jiffies = ULONG_MAX - (10 * 60 * hz); @@ -186,12 +180,9 @@ hardclock(struct clockframe *frame) jiffies++; /* - * Update real-time timeout queue. - * Process callouts at a very low cpu priority, so we don't keep the - * relatively high clock interrupt priority any longer than necessary. + * Update the timeout wheel. */ - if (timeout_hardclock_update()) - softintr_schedule(softclock_si); + timeout_hardclock_update(); } /* |
