From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <0c96ecd2b95642b0199eacca2aaea7ba@plan9.bell-labs.com> From: David Presotto To: 9fans@cse.psu.edu Subject: Re: [9fans] timesync is slow to set the time after boot In-Reply-To: <3E72CCA8.2030605@powell.name> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-yejtajnmayokcdprebiofaxnkv" Date: Sat, 15 Mar 2003 13:00:54 -0500 Topicbox-Message-UUID: 80fa2a7c-eacb-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-yejtajnmayokcdprebiofaxnkv Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit I stopped ignoring the first sample. It made some difference since the first sample is usually perverted a bit by the system starting up. However, it really doesn't help to have a wrong time for a minute. Thanks powell. --upas-yejtajnmayokcdprebiofaxnkv Content-Type: message/rfc822 Content-Disposition: inline Received: from plan9.cs.bell-labs.com ([135.104.9.2]) by plan9; Sat Mar 15 01:48:20 EST 2003 Received: from mail.cse.psu.edu ([130.203.4.6]) by plan9; Sat Mar 15 01:48:17 EST 2003 Received: from psuvax1.cse.psu.edu (psuvax1.cse.psu.edu [130.203.30.6]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id DDF9B19A10; Sat, 15 Mar 2003 01:48:07 -0500 (EST) Delivered-To: 9fans@cse.psu.edu Received: from out005.verizon.net (out005pub.verizon.net [206.46.170.143]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 35B1919A08 for <9fans@cse.psu.edu>; Sat, 15 Mar 2003 01:47:39 -0500 (EST) Received: from powell.name ([4.46.198.96]) by out005.verizon.net (InterMail vM.5.01.05.27 201-253-122-126-127-20021220) with ESMTP id <20030315064738.ETNS6910.out005.verizon.net@powell.name> for <9fans@cse.psu.edu>; Sat, 15 Mar 2003 00:47:38 -0600 Message-ID: <3E72CCA8.2030605@powell.name> From: Richard Powell User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: 9fans <9fans@cse.psu.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH at out005.verizon.net from [4.46.198.96] at Sat, 15 Mar 2003 00:47:38 -0600 Subject: [9fans] timesync is slow to set the time after boot Sender: 9fans-admin@cse.psu.edu Errors-To: 9fans-admin@cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.0.11 Precedence: bulk Reply-To: 9fans@cse.psu.edu List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Archive: Date: Fri, 14 Mar 2003 22:48:08 -0800 Hello 9fans, I've noticed that timesync takes a minute or so to set the system time from the PC clock after a boot. It seems that it ignores the first sample from the clock and sleeps for a minute before setting the time from a second sample. I've included a diff just to illustrate the issue. Does anyone know the circumstances that led to this? Are there problematic clocks out there:-) Maybe we could restrict the dalay to the cases where it's needed. Thanks, Richard diff -c timesync.org timesync.c.mod *** timesync.org Fri Mar 14 19:42:32 2003 --- timesync.c.mod Fri Mar 14 19:42:32 2003 *************** *** 375,382 **** s->stime = s->ltime + diff; // if the sample was bad or if this is the first sample, ignore it ! if(s->stime < 0 || !already){ ! already = 1; free(s); continue; } --- 375,383 ---- s->stime = s->ltime + diff; // if the sample was bad or if this is the first sample, ignore it ! // if(s->stime < 0 || !already){ ! // already = 1; ! if(s->stime < 0){ free(s); continue; } --upas-yejtajnmayokcdprebiofaxnkv--