Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 May 2007 15:23:53 +1000 (EST)
From:      Ian Smith <smithi@nimnet.asn.au>
To:        Martin Dieringer <martin.dieringer@gmx.de>
Cc:        Doug Barton <dougb@freebsd.org>, freebsd-stable@freebsd.org
Subject:   Re: clock too slow - big time offset with ntpdate
Message-ID:  <Pine.BSF.3.96.1070503145248.10187A-100000@gaia.nimnet.asn.au>
In-Reply-To: <20070503022338.P839@thinkpad.dieringer.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 3 May 2007, Martin Dieringer wrote:

 > On Wed, 2 May 2007, Doug Barton wrote:
 > 
 > > Martin Dieringer wrote:
 > >
 > >> On Wed, 2 May 2007, John Walthall wrote:
 > >> 
 > >>> On Tue, May 01, 2007 at 08:50:10PM +0200, Martin Dieringer wrote:
 > >>>> I think it has to do with powerd, if I kill that, the time stays correct.
 > >>> 
 > >>> With powerd enabled, are you able to maintain a "reasonably"
 > >>> correct time with frequent NTP syncronizations? Sorry if it's just
 > >>> me, but I am not quite clear about that, from what has been written
 > >>> already.
 > >> 
 > >> I would have to update every minute at least and would still be more
 > >> than 5 seconds off.
 > >
 > > I think you misunderstand how ntpd works vs. how ntpdate works.
 > > ntpd is a daemon, so you don't run it every minute, it runs in the
 > > background and keeps the clock up to date.
 > 
 > > Turn off all of the power management, and any other service that
 > > might be affecting the clock, and then reboot. If your system is
 > > able to maintain correct time under these circumstances, start
 > > adding things in until you find the culprit and let us know.
 > 
 > both laptops can keep the time without powerd. apm is enabled, but not
 > acpi. as soon as I start powerd or change cpu speed, time gets a few
 > seconds off.
 > It doesn't matter whether I use ntpd or ntpdate.
 > 
 > (ntpdate at system startup makes no sense as I have to dialup first).

If using ppp or mpd, you could run ntpdate from a link-up script.

But to address the underlying problem, quoting from earlier, you said:

 > > Now I got following while playing sound on the Compaq:
 > >
 > > kernel: calcru: runtime went backwards from 183711700 usec to 183167434 usec for pid 12 (swi4: clock sio)
 > >
 > > here I have a working clock, but also intermittent sound output

To which I suggested, after a bit of hunting:

 > http://www.freebsd.org/doc/en/books/faq/book.html#CALCRU-NEGATIVE
 > and
 > http://lists.freebsd.org/pipermail/freebsd-stable/ searching for
 > 'calcru: runtime went backwards' provides many hits, as does google;
 > seems it could be a number of things, perhaps choice of timecounter.

Also a bit further down in the FAQ:
 '5.25. Why does the clock on my laptop keep incorrect time?'

Have you had a look at those FAQ entries?  Might they be relevant?

How about showing us /var/run/dmesg.boot for at least one of these two
machines?  I'm still curious as to what Timecounter & HZ is selected:
show us 'sysctl kern.timecounter' and 'sysctl -a | grep -i cpu' ?

Cheers, Ian




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.1070503145248.10187A-100000>