From owner-freebsd-hackers Tue Dec 8 21:36:21 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA04892 for freebsd-hackers-outgoing; Tue, 8 Dec 1998 21:36:21 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from widefw.csl.sony.co.jp (widefw.csl.sony.co.jp [133.138.1.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA04884 for ; Tue, 8 Dec 1998 21:36:17 -0800 (PST) (envelope-from kjc@csl.sony.co.jp) Received: from hotaka.csl.sony.co.jp (root@hotaka.csl.sony.co.jp [43.27.98.57]) by widefw.csl.sony.co.jp (8.8.8/3.6W) with ESMTP id OAA11948; Wed, 9 Dec 1998 14:35:33 +0900 (JST) Received: from localhost (kjc@[127.0.0.1]) by hotaka.csl.sony.co.jp (8.8.8/3.6W/hotaka/98111120) with ESMTP id OAA20084; Wed, 9 Dec 1998 14:35:32 +0900 (JST) Message-Id: <199812090535.OAA20084@hotaka.csl.sony.co.jp> To: hackers@FreeBSD.ORG Cc: Anto Prijosoesilo Subject: HZ more than 500 in -stable Date: Wed, 09 Dec 1998 14:35:31 +0900 From: Kenjiro Cho Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Anto Prijosoesilo 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