Re: BogoMIPS

Richard B. Johnson (root@chaos.analogic.com)
Tue, 29 Sep 1998 08:54:16 -0400 (EDT)


On Tue, 29 Sep 1998, Martin Mares wrote:

> > I did the same thing for 2.0.x a long time ago. It helped for certain
> > chips, but it still jittered for others. And it depended on how the kernel
> > got compiled - there was one (German?) person in particular who took the
> > bogomips loop into user code and tried it with tons of different
> > placements, and showed that for his CPU it made a difference how it was
> > placed and what the surrounding code was.
> >
> > As a result, 2.0.x just does it as a separate subroutine in
> >
> > arch/i386/lib/delay.S
> >
> > and that pretty much forces it to not jitter at all. If you'd send me that
> > kind of patch I'd accept it.
>
> We already do it as a separate subroutine in 2.1 --
see arch/i386/lib/delay.c :-)
> Maybe adding align to the start of the loop should be even better...
>
> Have a nice fortnight
> --

That's what my patch does in the seperate subroutine. Further, it aligns
the delay-loop, not the code leading up to it. Further, it makes sure
I am not sitting on the end of a cache-line by taking two jumps before
the actual loop.

void __delay(unsigned long loops)
{
__asm__ __volatile__(
"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 WAS MODIFIED *****
Penguin : Linux version 2.1.123 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
Please read the FAQ at http://www.tux.org/lkml/