From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 26 22:47:12 2010 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7DC7106564A for ; Fri, 26 Mar 2010 22:47:12 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 777BA8FC15 for ; Fri, 26 Mar 2010 22:47:12 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id D2EAF1FFC22; Fri, 26 Mar 2010 22:47:10 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 96C43844CC; Fri, 26 Mar 2010 23:47:10 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Peter Jeremy References: <4BACC791.70502@icyb.net.ua> <86zl1v84vy.fsf@ds4.des.no> <4BACD88E.2040803@icyb.net.ua> <86vdcj82qx.fsf@ds4.des.no> <20100326213022.GD32799@server.vk2pj.dyndns.org> Date: Fri, 26 Mar 2010 23:47:10 +0100 In-Reply-To: <20100326213022.GD32799@server.vk2pj.dyndns.org> (Peter Jeremy's message of "Sat, 27 Mar 2010 08:30:23 +1100") Message-ID: <861vf6n1jl.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@FreeBSD.org, Andriy Gapon Subject: Re: periodically save current time to time-of-day hardware X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2010 22:47:12 -0000 Peter Jeremy writes: > At least some versions of Linux also save a RTC drift approximation > and "last set" timestamp whenever the RTC is updated. This allows the > kernel to better set the system clock from the RTC at boot (ie, our > inittodr()). The downside is that this needs to store 8-16 bytes of > state somewhere non-volatile. Linux does this using an external > program and a file - but finding a location for a regularly updated > file that is read very early in the rc.d sequence might be problematic. We already do something similar for entropy. > that it _is_ updated. This suggests that an alternative approach > would be for adjtime() / ntp_adjtime() to directly call resettodr() if > it's more than P minutes since resettodr() was last called. ...if we want something like Linux's eleven-minute-mode. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no