Re: linux-2.1.42 question

Richard B. Johnson (root@analogic.com)
Fri, 20 Jun 1997 16:15:24 -0400 (EDT)


On Fri, 20 Jun 1997, David S. Miller wrote:

> Date: Fri, 20 Jun 1997 22:23:38 +0400
> From: "A.N.Kuznetsov" <kuznet@ms2.inr.ac.ru>
>
> +#ifndef NO_ANK_FIX
> + __asm__ __volatile__ ("jmp 1f ; 1:");
> +#endif
> pg0[0] = old;
> local_flush_tlb();
>
> Apparently, it is a problem with tlb/command pipeline/hell-knows-more
>
> This may be "illusion", I frequently find that adding arbitrary extra
> instruction or some random data can make bugs disappear. Usually it
> is moving symbols in the kernel image and either:
>
> 1) avoiding some linker bug
> 2) restoring some alignment constraint which is needed
>
> Your change for example may have moved __init section into place which
> does not trip some bug in linker or something like this.
>

Well no. This is not DOS. The code "text" segment isn't accessible to
any data pointers. Therefore bugs of the nature you discribe won't be
affected by code placement. Alignment isn't necessary, although it
is helpful to improve execution speed, in the Intel environment. The
code generator will align the start of a function on a boundary you
describe. Adding a few code bytes will seldom move the next function
because of the existing "fill".

What this code does is flush the prefetch buffer. It may fix a processor
bug. Note that a TLB is about to be refreshed. Some of this flushing
of the prefetch cache is documented and some is not. Intel chips seldom
have these bugs, but the clones that try to be faster often do. The
way they get faster is by removing "unnecessary" states in their internal
state-machines. This often causes these kinds of bugs which have to be
fixed in software.

It can be argued that if you improve the speed of a processor by a few
percent, but have to add some code that, on the average, will be executed
infrequently, you have an overall gain in performance.

Cheers,
DJ
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Richard B. Johnson
Analogic Corporation
Email : rjohnson@analogic.com, johnson@analogic.com
Penguin : Linux version 2.1.42 on an i586 machine (66.15 BogoMips).
Warning : It's hard to stay on the trailing edge of technology.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-