> > At kernel boot, in time_init (which should run with interrupts
> > disabled),
> >
> > a) Do a busy wait on the CTC timer until it zeroes.
> > b) Now read the TSC.
> > c) Do another busy wait on the CTC timer until it zeroes.
> > d) Read the TSC again.
> > e) The difference in TSC readings is our cpu_clock_cycles/jiffy.
>
> That's really quite nice.
> I double-checked, interrupts *are* disabled (from all sources) during
> time_init().
> It still doesn't really change the variable-clock-speed problem, though.
> (CPU halt, a turbo button, APM slowing the clock...)
> But I guess if you screw with your CPU speed you deserve the timing
> problems you get.
while I really like the idea of calibration at boot time, I don't agree
with your last sentence.
I'm using a PentiumOverdrive PODP83, which as a Intel builtin fan
(like `Intel-in-a-box and P-II nowadays). the CPU can check the
fan and will switch off internal clock multiplying when the fan
stops working (and sets some flag in a processor register).
when this happens (and it happend once because of too much dust)
the processor clock was reduced rom 83 MHz to 33 MHz and I was
_very_ happy that Linux did _not_ crash and did _not_ show too much
weird timing problems. I wouldn't like to see Linux getting
more instable in this respect.
maybe there is a way to check calibration from time to time
(every 100 or 1000 jiffies) and take some action (or at least
issue a warning etc.) when a major difference is detected ?
Harald
-- All SCSI disks will from now on ___ _____ be required to send an email notice 0--,| /OOOOOOO\ 24 hours prior to complete hardware failure! <_/ / /OOOOOOOOOOO\ \ \/OOOOOOOOOOOOOOO\ \ OOOOOOOOOOOOOOOOO|// Harald Koenig, \/\/\/\/\/\/\/\/\/ Inst.f.Theoret.Astrophysik // / \\ \ koenig@tat.physik.uni-tuebingen.de ^^^^^ ^^^^^- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu