Re: bogomips in 2.0.34

Richard B. Johnson (root@chaos.analogic.com)
Sat, 27 Jun 1998 22:34:18 -0400 (EDT)


On Sat, 27 Jun 1998, David Heitmann wrote:
[SNIPPED]
>
> But the code in arch/i386/lib/delay.S uses the ENTRY macro
> that is defined in include/linux/linkage.h, which, if I'm
> reading correctly, is using an ".align 16, 0x90" assembler
> directive in my case. Why would the code be misaligned?
> Is there a problem with the assembler or the linker?
>
This is not the code used to calculate BogoMips on my machine, you
must be using an older kernel. This one is 2.1.105 but the patch
whill work for most earlier and all later ones.

The actual delay loop is not aligned, only the start of the code...
The patch I submitted for testing, in which I have gotten no comments
at all (ignored), solves these problems for all systems tested.

--- 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");

--- snip ---

There are two jumps to aligned code for good reasons. Unless you have
access to as many different machines as I do, you don't want to second-
guess me on this one.

Note that BogoMips is BOGUS in any event. You will encounter pipeline
stalls at various places throughout the kernel code which, on the average,
do not affect the performance in any measurable way.

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