Re: strange AMD x Intel Behaviour in 2.4.26

From: Fabiano Ramos
Date: Thu Oct 07 2004 - 17:35:19 EST


On Thu, 2004-10-07 at 23:40 +0200, Andi Kleen wrote:
> 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.
>

OK, I'll check it. But I will still need to stick with the stop-at-
every-instruction approach, since this counting is just the start of
my project. I am developing a intepretation-like scheme, and need do
do some action at every instruction. The counting was just the stopping
mechanism. I do not use ptrace, since I want to do it in kernel space.

Thanks, it was giving me nightmares :(


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