Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Sep 1999 10:39:27 -0400 (EDT)
From:      Luoqi Chen <luoqi@watermarkgroup.com>
To:        luoqi@watermarkgroup.com, phk@critter.freebsd.dk
Cc:        current@FreeBSD.ORG, smp@FreeBSD.ORG
Subject:   Re: Testers please!
Message-ID:  <199909221439.KAA05687@lor.watermarkgroup.com>

next in thread | raw e-mail | index | archive | help
> >TSC is initialized to 0 at hardware reset, which should happen to all CPUs
> >at the same time (invalid assumption?), in another words, all TSCs should be
> >automatically synchronized.
> 
> They are not.  The PLL is local to each cpu and every single
> clock-stop/start event has then inching away from each other because
> the on-chip VCO is very temperature dependent.  Furthermore Linux

The internal clock is phase-locked to an external clock source, which should
be the same bus clock and identical for all cpus. The multipliers for the
internal clocks should also be identical (in almost all cases unless you
design your own mother board). The highest multiplier as of today is 6x
(600MHz cpu on a 100MHz bus), it might increase over time, but I expect it
to be still around 10. If the PLL's accuracy is 1%, the difference between
two cpus could at most be 10% (or 3% = 1% * sqrt(10), assuming a Gaussian
distribution of the drift) of the internal clock cycle, that is 10% (3%) of the
time you might get two different readings (differ by 1) if you read TSCs of
two cpus simultaneously, that's still much more accurate than the i8254 timer.

> people have found sufficiently many cases where the counters are
> not in sync after the BIOS is done.
> 
I would really like to know how they managed to read the TSCs simultaneously,
or they resorted to some kind of statistical means (which I tried without
much success, maybe I will try later with some kernel hooks).

The multiplier is set at hard reset, so BIOS couldn't change that (some
mother boards may be soft configurable, but the change has to take effect
after next reset). Bus clock is external, BIOS couldn't change that either.
So the internal clock is not affected by BIOS. Now it would be really hard 
or me to believe that TSC is not a simple counter that increments at each
internal clock edge. I am very skeptical about the Linux people's findings.

> --
> Poul-Henning Kamp             FreeBSD coreteam member
> phk@FreeBSD.ORG               "Real hackers run -current on their laptop."
> FreeBSD -- It will take a long time before progress goes too far!
> 

-lq


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199909221439.KAA05687>