linux-mips
[Top] [All Lists]

Re: [patch] Generic time fixes

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [patch] Generic time fixes
From: Jun Sun <jsun@mvista.com>
Date: Tue, 22 Jul 2003 10:16:54 -0700
Cc: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>, Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de>, linux-mips@linux-mips.org, jsun@mvista.com
In-reply-to: <20030722100444.GA4148@linux-mips.org>; from ralf@linux-mips.org on Tue, Jul 22, 2003 at 12:04:44PM +0200
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <Pine.GSO.3.96.1030722093500.607A-100000@delta.ds2.pg.gda.pl> <20030722100444.GA4148@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.2.5i
On Tue, Jul 22, 2003 at 12:04:44PM +0200, Ralf Baechle wrote:
> On Tue, Jul 22, 2003 at 09:58:46AM +0200, Maciej W. Rozycki wrote:
> 
> >  Before I proceed further I need to get an aswer to the following
> > question: why do we use rtc_set_time() for NTP RTC updates instead of
> > rtc_set_mmss() like most other architectures do?  Traditionally Linux only
> > updated minutes and seconds in this context and I don't think we need to
> > do anything more.  And setting minutes and seconds only is way, way
> > faster. Which might not matter that much every 11 minutes, except doing
> > things slowly here incurs a disruption in the latency of the timer
> > interrupt, which NTP might not like and the slow calculation of the RTC
> > time causes less precise time being stored in the RTC chip. 
> > 
> >  It's already questionable whether the update should be done at all (this
> > was discussed zillion of times at the NTP group) and it disrupts
> > timekeeping of the DECstation severely, but given the current choice, I'd
> > prefer to make it as lightweight as possible.
> 
> It's a common case to have a system boot up with the RTC date being
> completly off, then syncing via ntpdate and xntp to the accurate time.
> If in that situation we only update the time the RTC will stay way far
> from reality.  Another case would be updates of the time near midnight
> where the RTC and NTP date happen to just differ.
> 
> I share your dislike of updating the RTC for performance reasons; these
> chips are impressive performance pigs.  So how about updating the RTC
> date only when
> 
>  - write the time to the RTC for the first time after NTP synchronizes

"First time after NTP synchronization" is not readily known to arch
time code.  This will involve kernel common code change.

>  - write the time to the RTC if xtime.tv_sec <= last_rtc_update + 660
>

Do you mean "xtime.tv_sec > last_rtc_update + 660", which is already
the case?

Again, board does have choice as to whether it wants RTC update or not.

Jun

<Prev in Thread] Current Thread [Next in Thread>