BogoMips

Richard B. Johnson (root@chaos.analogic.com)
Wed, 24 Jun 1998 11:10:56 -0400 (EDT)


This subject has come up so may times I thought I would take a look
at it. Most know that BogoMips stands for "bogus" and is just a number
obtained to calibrate short delay-loops. However, some are disturbed
that recompiling the kernel will sometimes result in a different
number. Even though this number means nothing to the end-user, to
help prevent it from changing, I have provided this patch. It should
patch cleanly on most recent kernels.

It has been tested on a 40MHz i386, 66MHz i486, 90MHz pentium, 160MHz
Pentium II, and a 300Mhz Pentium MMX. The numbers remain stable regardless
of the forced alignment. It just forces two consecutive jumps to aligned
code before the delay-loop, but after EAX is loaded with the count. This
should get you off the trailing edge of a cache-line.

If you testers like it, I will send it to Alan or Linus. If it doesn't
fix a bobbling BogoMips count, let me know. Note +/- 1 count is normal.

--- linux/arch/i386/lib/delay.c.orig Wed Jun 24 10:22:50 1998
+++ linux/arch/i386/lib/delay.c Wed Jun 24 10:18:52 1998
@@ -18,7 +18,11 @@
void __delay(unsigned long loops)
{
__asm__ __volatile__(
- "1:\tdecl %0\n\tjns 1b"
+ "jmp 1f\n"
+ ".align 16\n"
+ "1:\tjmp 2f\n"
+ ".align 16\n"
+ "2:\tdecl %0\n\tjns 2b"
:/* no outputs */
:"a" (loops)
:"ax");

Cheers,
Dick Johnson
***** FILE SYSTEM MODIFIED *****
Penguin : Linux version 2.1.105 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu