Re: strange AMD x Intel Behaviour in 2.4.26

From: Andi Kleen
Date: Thu Oct 07 2004 - 16:50:48 EST


Fabiano Ramos <ramos_fabiano@xxxxxxxxxxxx> writes:

> The code is producing correct results (same as ptrace, I mean)
> but is RUNNING FASTER on a 500Mhz AMD K6-2 than on a 2.6Ghz HT
> Pentium 4 !!!! The monitored code runs faster on P4 if not being

The Pentium 4 is slow for anything that involves changing of the
ring or an exception. Well known problem, you can see it in other
benchmarks too. Normally the penalty is not that drastic, probably
it doesn't like single stepping very much.

However a cheaper way to do this would be to use performance counters
and save/restore them on each context switch. There is normally a
perfctr for "retired instructions on ring 3", which is what you
want. Mikael P's perfctr patchkit can do that per process.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/