Re: Intel P6 vs P7 system call performance

From: Linus Torvalds (torvalds@transmeta.com)
Date: Thu Dec 19 2002 - 18:30:23 EST


On Thu, 19 Dec 2002, Linus Torvalds wrote:
>
> So it's between 0-4 cycles on machines that take 200 - 1000 cycles for
> just the system call overhead.

Side note: I'd expect indirect calls - and especially the predictable
ones, like this - to maintain competitive behaviour on CPU's. Even the P4,
which usually has really bad worst-case behaviour for more complex
instructions (just look at the 2000 cycles for a regular int80/iret and
shudder) does a indirect call without huge problems.

That's because indirect calls are actually very common, and to some degree
getting _more_ so with the proliferation of OO languages (and I'm
discounting the "indirect call" that is just a return statement - they've
obviously always been common, but a return stack means that CPU
optimizations for "ret" instructions are different from "real" indirect
calls).

So I don't worry about the indirection per se. I'd worry a lot more about
some of the tricks people mentioned (ie the "pushl $0xfffff000 ; ret"
approach probably sucks quite badly on some CPU's, simply because it does
bad things to return stacks on modern CPU's - not necessarily visible in
microbenchmarks, but..).

                        Linus

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



This archive was generated by hypermail 2b29 : Mon Dec 23 2002 - 22:00:25 EST