Re: one more small fix for 2.0.31

Andrej Presern (andrejp@luz.fe.uni-lj.si)
Wed, 27 Aug 1997 22:03:21 +0200


This is exactly what I've reported a few weeks ago but there didn't
seem to be any response to the problem. Please, do include this in
the new kernel.

Andrej

Harald Koenig wrote:
>
> this patch fixes a real problem with the delay loop for at least
> Pentium OverDrive CPUs, it's not intented to get more bogosity
> or similar, so please read on below and pls test for other CPUs... !!
>
> diff -ur /soft/linux/include/asm-i386/delay.h linux/include/asm-i386/delay.h
> --- /soft/linux/include/asm-i386/delay.h Thu Jan 18 23:50:24 1996
> +++ include/asm-i386/delay.h Wed Aug 27 10:47:08 1997
> @@ -14,7 +14,7 @@
> extern __inline__ void __delay(int loops)
> {
> __asm__ __volatile__(
> - ".align 2,0x90\n1:\tdecl %0\n\tjns 1b"
> + ".align 8,0x90\n1:\tdecl %0\nnop\n\tjns 1b"
> :/* no outputs */
> :"a" (loops)
> :"ax");
>
> browsing through my own kernel tree again I found one small patch
> which I'd really like to get into 2.0.31.
>
> using my PentiumOverdrive PODP83 CPU, I get very different actual delays
> from udelay() depending on the alignment where udelay() or __delay()
> gets used. worst case errors are a factor of 2.5 !!
>
> depending on the alignment of the __delay() routine (add some NOPs before it
> e.g.) in the BogoMips measurement I get either 26, 33, 52.5 or 83 bogomips
> (this depends e.g. on which kernel config options I use).
<snip>