[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Re: Performance overhead of paravirt_ops on native identified



H. Peter Anvin wrote:
That's an indirect jump, though.  I don't think anyone was suggesting
using an indirect jump; the final patched version should be a direct
jump (instead of a direct call.)

I can see how indirect jumps might be slower, since they are probably
not optimized as aggressively in hardware as indirect calls -- indirect
jumps are generally used for switch tables, which often have low
predictability, whereas indirect calls are generally used for method
calls, which are (a) incredibly important for OOP languages, and (b)
generally highly predictable on the dynamic scale.

However, direct jumps and calls don't need prediction at all (although
of course rets do.)

I did a quick experiment to see how many sites this optimisation could actually affect. Firstly, it does absolutely nothing with frame pointers enabled. Arranging for no frame pointers is quite tricky, since it means disabling all debugging, tracing and other things.

With no frame pointers, its about 26 of 5400 indirect calls are immediately followed by ret (not all of those sites are pvops calls). With preempt disabled, this goes up to 45 sites.

I haven't done any actual runtime tests, but a quick survey of the affected sites shows that only a couple are performance-sensitive; _spin_lock and _spin_lock_irq and _spin_lock_irqsave are the most obvious.

   J

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.