On Fri, 8 Jul 2011, Richard Henderson wrote:

> On 07/08/2011 01:23 AM, Richard Earnshaw wrote:
> > There is a slight performance hit to using a VDSO in that each entry
> > will need to go through the PLT rather than jumping directly to the
> > helper function in the kernel.
> 
> Yes.  But IMO the flexibility gained is worth it.

I'm not sure I agree.  We're talking about extremely lightweight 
functions here, in the order of a very few assembly instructions only.  
Adding a significant overhead relative to their cost is not very 
appealing.  For example, we have this code located at 0xffff0fe0 to 
retrieve the TLS value.  Here's the non-SMP implementation:

        ldr     r0, [pc, #(16 - 8)]
        bx      lr

Of course the location relative to the pc where the TLS value is 
retrieved is implementation specific and not part of the ABI at all.  
Yet, some people found the call to this code too much overhead and 
started fetching the TLS value directly from memory themselves (*).  
Obviously their program would break if executed on a SMP system because 
then the TLS value is not stored in memory.  But my point is that they 
were willing to do such hacks to completely avoid the call overhead, and 
in such cases I don't see adding to it with a full blown VDSO as 
something positive.

(*) I even considered changing the location of the TLS value in that 
    case to break those abusers and make it clear that this is not the 
    proper interface.


Nicolas

_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to