Re: Wrong bogomips after plugging in AC power

Pavel Machek (pavel@suse.cz)
Sun, 31 Oct 1999 11:46:44 +0100


Hi!

> > Would laptops need a bogomips.conf file in their /etc directory, or do APM
> > and what not have an API that can tell us that on most systems that change
> > clock speed? Or is there a super fast and dirty check we can do to "guess"
> > from a group of logical speeds which one we're running.
>
> I don't know if APM warns you about the changed processor speed, but if
> it does, I'm sure it will vary wildly between computers. A userland program
> to inform the kernel would be nice. If APM doesn't tell you, the userland
> program will till be able to recompute the processor speed using things
> as load average, initial CPU speed, and the time do to spin in a closed
> loop.

That is not going to work. It is too late by then. One single wrong
udelay() can corrupt your data, or crash your machine [assuming broken
hw. On good hw, no udelay is needed]. You should not run with wrong
bogomips, not even for short periods between real change and you
noticing it...

What are other possible timebases? [I'm talking i386 architecture]

loops - thats what we have
clock counter - changes with bogomips
rtc - it has 32khz time base (IIRC), that gives 31usec
granularity. Not enough.
timer - it has 16bit counter, and runs 18 times a second
when 65535 is used as divider. That gives me 0.84usec precission (good
enough). I just wonder how long it takes to do_read_hwtimer()...

Any other ideas?
Pavel

-- 
I'm really pavel@ucw.cz. Look at http://195.113.31.123/~pavel.  Pavel
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!

- 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/