From 9207f00ac04e930a40a2caf6fd347d246bf193fd Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Mon, 26 Jun 1995 07:48:50 +0000 Subject: [PATCH] The pessimistic rounding in hzto() was too pessimistic for realitimexpire(). --- sys/kern/kern_time.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 319b00ac5783..7828751e67dc 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_time.c 8.1 (Berkeley) 6/10/93 - * $Id: kern_time.c,v 1.7 1995/03/16 18:12:38 bde Exp $ + * $Id: kern_time.c,v 1.8 1995/05/30 08:05:47 rgrimes Exp $ */ #include @@ -295,6 +295,10 @@ setitimer(p, uap, retval) * Else compute next time timer should go off which is > current time. * This is where delay in processing this timeout causes multiple * SIGALRM calls to be compressed into one. + * hzto() always adds 1 to allow for the time until the next clock + * interrupt being strictly less than 1 clock tick, but we don't want + * that here since we want to appear to be in sync with the clock + * interrupt even when we're delayed. */ void realitexpire(arg) @@ -315,7 +319,7 @@ realitexpire(arg) &p->p_realtimer.it_interval); if (timercmp(&p->p_realtimer.it_value, &time, >)) { timeout(realitexpire, (caddr_t)p, - hzto(&p->p_realtimer.it_value)); + hzto(&p->p_realtimer.it_value) - 1); splx(s); return; }