Re: BogoMIPS

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Wed, 7 Oct 1998 15:17:53 +0100


On Tue, Oct 06, 1998 at 09:25:55PM -0600, Michal Jaegermann wrote:
> This is a rather small loop. Maybe it would be enough to align it
> on the next power of 2 not bigger than a code size? That would ensure
> that one is not cycling across a page boundary.

GNU as has a directive to "align to the next N byte boundary if there
are fewer than X bytes to the boundary".

It's there because of some Intel optimisation recommendation, I think
maybe EGCS uses it.

Anyway, that would be the appropriate thing to use to avoid crossing a
page boundary. This should sort out cache line alignment, prefetch
queue flush, not crossing a page boundary, and keeping the prefetch
(subseqeuent instructions) also within the same page. Overkill perhaps,
but thorough :-)

pushl %cs
pushl $0f
lretl # Far jump forces prefetch queue flush.
.balign 32 # Size of Pentium & later cache lines.
.balign 4096,,64 # Align to page if prefetch (two cache lines)
# would cross the next page boundary.
0: decl %eax
jns 0b
retl

-- Jamie

-
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/