diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2000-08-23 20:36:19 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2000-08-23 20:36:19 +0000 |
commit | 80c98207a4578bed97cb5120669edf396363d767 (patch) | |
tree | 9fc98c1b780f7adff29ee6270df9feb20a3b5b6d /sys/kern/kern_clock.c | |
parent | 8788e63fb756ccf14d8413394057f9275529df94 (diff) |
Move the updating of timeout queues to after ticks is incremented.
The older code actually ensured that no timeout would be too early, but
it violated the principle of least surprise by making it seem (when you
looked at the time variable) that every timeout was one tick late.
Also periodic timeouts (that readd themselves in the timeout function),
will now happen with the frequency you expect.
Diffstat (limited to 'sys/kern/kern_clock.c')
-rw-r--r-- | sys/kern/kern_clock.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 125dffef205..f9e89160967 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_clock.c,v 1.26 2000/07/07 15:37:00 art Exp $ */ +/* $OpenBSD: kern_clock.c,v 1.27 2000/08/23 20:36:18 art Exp $ */ /* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */ /*- @@ -353,7 +353,7 @@ hardclock(frame) register struct clockframe *frame; { register struct proc *p; - register int delta, needsoft; + register int delta; extern int tickdelta; extern long timedelta; #ifdef NTP @@ -362,11 +362,6 @@ hardclock(frame) register int ltemp; #endif - /* - * Update real-time timeout queue. - */ - needsoft = timeout_hardclock_update(); - p = curproc; if (p) { register struct pstats *pstats; @@ -673,10 +668,11 @@ hardclock(frame) #endif /* NTP */ /* + * 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. */ - if (needsoft) { + if (timeout_hardclock_update()) { if (CLKF_BASEPRI(frame)) { /* * Save the overhead of a software interrupt; |