From owner-freebsd-hackers Wed Apr 7 12:55:42 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (Postfix) with ESMTP id 5883514E85; Wed, 7 Apr 1999 12:55:19 -0700 (PDT) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.1a/8.9.1) with ESMTP id VAA01709; Wed, 7 Apr 1999 21:53:18 +0200 (CEST) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id VAA76780; Wed, 7 Apr 1999 21:53:15 +0200 (MET DST) Date: Wed, 7 Apr 1999 21:53:14 +0200 From: Eivind Eklund To: Nick Sayer Cc: hackers@freebsd.org Subject: Re: cvs commit: src/sys/kern kern_time.c Message-ID: <19990407215314.B75317@bitbox.follo.net> References: <199904071924.MAA05436@apollo.backplane.com> <199904071932.MAA38634@medusa.kfu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i In-Reply-To: <199904071932.MAA38634@medusa.kfu.com>; from Nick Sayer on Wed, Apr 07, 1999 at 12:32:51PM -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG [Moved to -hackers] On Wed, Apr 07, 1999 at 12:32:51PM -0700, Nick Sayer wrote: > > :On Apr 7, 9:36am, Nick Sayer wrote: > > :} Subject: cvs commit: src/sys/kern kern_time.c > > : > > :} We still need to decide on an algorithm to clamp positive adjustments. > > :} As it stands, it is possible to achieve arbitrary negative adjustments > > :} by "wrapping" time around. > > : > > :Limit positive steps to MIN(1 second, elapsed time since last postive step). > > :At worst the clock could be made to run at 2x normal speed. > > I was looking at a much uglier version of the above, involving > having a 'step allowed' variable that gets cleared by the clock > interrupt or something, but the above looks much nicer. Let me > go to my little workshop. :-) I'd suggest going for at least a minute instead of a second, to allow re-adjustement after loosing an ntp server for a while. Possibly more; I've not thought too closely about this. It might be reasonable to do maxstep = MIN(1 minute, elapsed time since last positive step / 10) to keep the present "max 10% time adjustement" limitation. Eivind. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message