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: TSX lock elision for glibc v2


On Fri, 2013-01-11 at 23:29 +0100, Andi Kleen wrote:
> > What about the internal locks used in the condvar and rwlock
> > implementations?  We might perhaps be able to build better concurrent
> 
> x86 rwlocks don't use locks, and I already elide then.

sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S lines 46-76,
for example.  Are we looking at the same code?

OTOH, elision might not provide too much benefit for these because most
critical sections write to likely the same cacheline as the lock. The
try{rd,wr}lock functions don't in the failure case, but I'm not sure how
frequently they are used.

> Please see patch 6/10
> 
> Condition variables may be done at some point. But it will also
> only help specific cases -- as soon as the condition
> variable blocks it has to abort of course. Code contributions 
> welcome.

Well, the cond vars also use an internal lock, but like the rwlock, it
might need a bigger change in the algorithm to be friendly to elision.


Torvald


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