Re: [PATCH] HZ=100 assumptions

Stephen C. Tweedie (jelle@flying.demon.nl)
Thu, 29 Jul 1999 23:44:33 +0200 (NST)


On Thu, 29 Jul 1999, Steve Underwood wrote:

> "Albert D. Cahalan" wrote:
>
> > Eric Lammerts writes:
> > > On Wed, 28 Jul 1999, Riley Williams wrote:
> >
> > >> However, the standard used by MSDOS (which I assume is what you're
> > >> referring to) is for the clock to tick ~18.2 times per second (to
> > >> be more accurate, 65536 ticks per hour), in which case the correct
> > >
> > > This is incorrect. The BIOS/MSDOS clock is generated from a 14.31818MHz
> > > crystal clock divided by 12 * 65536.
> >
> > Nope. Clock frequency varies. Originally it was related to a standard
> > video frequency. More recent computers use a frequency designed to make
> > DOS timekeeping be more accurate. (the 65536 ticks/hour I suppose)
>
> Nope. Many modern computers use an el. cheapo clock that is just plain
> inaccurate, and they don't keep time very well. Any Compaq ProLiant produced
> in the last 6 years keeps time to no better than plus or minus one to two
> minutes per day. Since these are generally used as servers, its a significant
> pain in the posterior - unless you are connected to the Internet, or have
> some other way to sync. the time of day to an external source.

Just some observations.

65536 ticks per hour would be approx 18.2hz, which definitely can't be
true. Timekeeping accuracy does not depend on the actual value of the
oscillator frequency, but of course it depends how precisely the
oscillator frequency matches the agreed standard frequency, and on it's
stability. The el. cheapo oscillator story sounds more feasible. I believe
the clock kept in the CMOS RAM uses a different time base, so in theory it
would be possible to regularly syncronize the 'DOS clock' to the CMOS
clock, which already happens when a computer is rebooted, so the
motherboard manufacturers are reasoning 'we're saving money, and software
can fix it, so lets do it'.

I scanned some PI mainboards and a PII board for the crystal oscillators,
and all of them have a crystal on which at least the digits "14.3" are
written, some of them "14.318", and an Intel TX-based socket 7 motherboard
even has the full "14.31818" written on its oscillator. We can calculate
that a clock of 14.30000Mhz instead of 14.31818Mhz would result in the
clock lagging approx. 1.8 minutes per day. If the '14.3' crystals can
range from 14.25..14.35 Mhz, then te clock error can be, in extremes -6.8
minutes to +3.2 minutes per day. So your story of el. cheapo oscillators
could be true for compaq (and for some of my boards). Maybe compaq figured
computers would be switched on at the beginning of each workday, and that
a time difference of less than 2.5 minute per workay in extreme cases
would be sufficiently precise. For a computer that reboots (crashes) every
3 hours, the maximum time difference would always be less than a minute!
(?)

Hmm, that brings a whole new light to the logo 'Designed for Windows'...

alias of 'Should reboot often to keep time accurate?'

> In several stand alone systems I have had to use NTP to sync the Compaq
> machines to cheap no-name Taiwanese ones that are accurate to a few seconds
> per month. Silly, ain't it.

A 14.318 crystal, which could be in the range 14.3175..14.3185Mhz would
result in extremes of -2 minutes to +0.96 minutes difference per month. A
14.31818 crystal, would result in less than a second difference per month.

So, the conclusion is that if you find the accuracy of the timekeeping
important, then look for the oscillator on the motherboard (tiny metal
box), and make sure it says "14.31818" on it...

Jelle

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/