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/