From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 6 12:47:40 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 E39861065672; Tue, 6 Apr 2010 12:47:40 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id F2D418FC19; Tue, 6 Apr 2010 12:47:39 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA28670; Tue, 06 Apr 2010 15:47:38 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4BBB2D69.80002@freebsd.org> Date: Tue, 06 Apr 2010 15:47:37 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100319) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <4BACC791.70502@icyb.net.ua> <20100327214634.GI32799@server.vk2pj.dyndns.org> <86fx3k7jqi.fsf@ds4.des.no> <201003291044.28544.jhb@freebsd.org> <4BB22A42.7050003@icyb.net.ua> In-Reply-To: <4BB22A42.7050003@icyb.net.ua> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= 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: Tue, 06 Apr 2010 12:47:41 -0000 on 30/03/2010 19:43 Andriy Gapon said the following: > > do you think that periodic saving of system clock to hardware and making resettodr > asynchronous are dependent issues? Or are they orthogonal and can be implemented > independently? A new version of the patch: http://people.freebsd.org/~avg/periodic_resettodr.diff Some notes: - this patch doesn't implement any resettodr enhancements proposed earlier: making it non-blocking/asynchronous and saving time closer to seconds boundary; - the patch adds code for saving time on shutdown, adds logic for checking ntp synchronization status and for dynamically stoping/(re-)starting the callout via period sysctl; - the patch consists of two pieces: the first is abstracting ntp status check into a separate function and the other is all the time saving code; - I don't feel that kern_ntptime.c is best place for this code, I only chose it because of ntp status checking; perhaps ntp_is_time_error needs to be made public and the code moved to a better file; suggestion are welcome! I also welcome any comments and suggestions on code style, identifier naming, logic, strategy, etc. Thank you! P.S. it seems that machdep is not the best place for "RTC" sysctls, but I am deferring this issue at the moment. -- Andriy Gapon