Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 Dec 1998 14:35:31 +0900
From:      Kenjiro Cho <kjc@csl.sony.co.jp>
To:        hackers@FreeBSD.ORG
Cc:        Anto Prijosoesilo <antop@netscape.net>
Subject:   HZ more than 500 in -stable
Message-ID:  <199812090535.OAA20084@hotaka.csl.sony.co.jp>

next in thread | raw e-mail | index | archive | help

Anto Prijosoesilo <antop@netscape.net> reported to me that
the 2.2.8 kernel panics with divide by zero in adjtime() when HZ is
set to more than 500.

The cause of the problem is that "tickadj" is initialized to 0 and
this problem was already fixed in -current by bde on Jun 21.

Any objections to merge this fix into -stable?

(ALTQ and dummynet work better with a higher timer resolution.)

--Kenjiro

===================================================================
RCS file: /home/ncvs/src/sys/conf/param.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -p -u -r1.27 -r1.28
--- src/sys/conf/param.c        1998/05/15 20:10:54     1.27
+++ /home/ncvs/src/sys/conf/param.c     1998/06/21 12:22:35     1.28
@@ -36,7 +36,7 @@
  * SUCH DAMAGE.
  *
  *     @(#)param.c     8.3 (Berkeley) 8/20/94
- * $Id: param.c,v 1.27 1998/05/15 20:10:54 wollman Exp $
+ * $Id: param.c,v 1.28 1998/06/21 12:22:35 bde Exp $
  */
 
 #include "opt_sysvipc.h"
@@ -70,7 +70,7 @@
 #endif
 int    hz = HZ;
 int    tick = 1000000 / HZ;
-int    tickadj = 30000 / (60 * HZ);            /* can adjust 30ms in 60s */
+int    tickadj = howmany(30000, 60 * HZ);      /* can adjust 30ms in 60s */
 #define        NPROC (20 + 16 * MAXUSERS)
 #define MAXFILES (NPROC*2)
 int    maxproc = NPROC;                        /* maximum # of processes */



===================================================================
1.28 Sun Jun 21 12:22:35 1998 UTC by bde 

Round tickadj up.  This prevents tickadj from being 0 when HZ > 500,
which makes adjtime(2) useless and confuses xntpd(8) into refusing
to start even when it would use the kernel PLL instead of adjtime().
The result is the same as recommended by tickadj(8), at least when
HZ divides 10^6.  Of course, you wouldn't want to actually use
adjtime() when HZ is large.  In the silly boundary case of HZ == 10^6,
tickadj == tick == 1 so the clock stops while adjtime() is active.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812090535.OAA20084>