This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Lock elision implementation guidelines


Torvald Riegel <triegel@redhat.com> writes:
>
> Andi said that in his measurements, the overhead would be negligible.
> Could any of you share the actual numbers?

The original version used ifunc to patch in a separate
pthread_mutex_lock, but that caused various problems. 

I measured it without it and there was no measurable difference (any
deltas were below the measurement inaccuracy).

Elision is a separate lock type.

By default when you run it on a system without elision support it will
use the standard non eliding lock type. The only extra cost here is the
upgrade check (move from timed to elided) which was non measurable.

The elided lock type has a check if elision is available and if yes an
extra tail call (tail calls are much cheaper than normal function
calls, but then even the later are not expensive on a modern system).

For a system with elision this path (until the check) would be only
taken if the application sets an elision lock type explicitely.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]