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 Wed, 2013-01-16 at 10:30 -0800, Andi Kleen wrote:
> Torvald Riegel <triegel@redhat.com> writes:
> 
> > 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?
> 
> This is already elided in my patchkit. Please see patch 6/10.

No, you don't.  What you do is doing lock elision for the whole duration
during which the program holds the readlock.  Which is fine, but won't
work if you do I/O in the program's critical section or such.

Therefore, I asked whether you had looked at eliding the internal locks,
so doing elision during the critical sections _within_ the rwlock calls.
As I wrote in previous emails, this might need changes to the internal
locking / synchronization scheme to be worthwhile.  But that's why I
asked you.


Torvald


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