Subject: Re: Different speed CPUs show up as same speed
To: <>
From: David Laight <david@l8s.co.uk>
List: tech-smp
Date: 06/18/2002 14:17:07
On Tue, Jun 18, 2002 at 08:30:57AM -0400, Peter Hufnagel wrote:
> "Calibrated loops" -- ugh.
> 
> At my job we have a bunch of machines down in labs that have custom
> written code with "calibrated timing loops" written for the specific
> processor...  and now, years after we have pretty much trashed all the
> 286/386 class machines, we've got guys in the labs looking for "spare"
> 12-Mhz 286 machines and 386SX/16's "because it would cost us $40k in
> engineering time to rewrite the code".

Those are probably 'uncalibrated' loops!
Such tricks as 'jmps .+2' and 'shr al,cx' (when cx is large)
were used for delays on the 286.  Some of that code worked
for a long time - typically because no one had allowed for the
time taken to call the delay routine.

The kernel (probably) has a bit if code run during startup
that determines how many times it goes around a tight loop
between 2 clock ticks.  This is used to calibrate loop
delays - often used for microsecond delays.

Now if your two processors are different speeds, and the calibration
is done of the slow cpu then the fats one won't wait long enough.
This might matter...

	David

-- 
David Laight: david@l8s.co.uk