This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: TSX lock elision for glibc v10
- From: Rich Felker <dalias at aerifal dot cx>
- To: Torvald Riegel <triegel at redhat dot com>
- Cc: Andi Kleen <andi at firstfloor dot org>, libc-alpha at sourceware dot org
- Date: Thu, 13 Jun 2013 15:35:14 -0400
- Subject: Re: TSX lock elision for glibc v10
- References: <1370969416-8337-1-git-send-email-andi at firstfloor dot org> <1371140799 dot 16968 dot 19087 dot camel at triegel dot csb>
On Thu, Jun 13, 2013 at 06:26:39PM +0200, Torvald Riegel wrote:
> On Tue, 2013-06-11 at 09:50 -0700, Andi Kleen wrote:
> > Some bug fixes compared to the last version. Should be ready
> > for merging.
>
> I disagree that this is ready for merging.
>
>
> 1) It breaks the semantics of PTHREAD_MUTEX_NORMAL because it doesn't
> guarantee to block when trying to lock an already acquired mutex. Rich
> Felker has brought up convincing arguments why this can be use in
> correct programs. See http://sourceware.org/glibc/wiki/LockElisionGuide
> and the comment in patch 3.
It seems the intent of this patch is to work around the issue by never
using elision unless it's explicitly requested. However, if I'm not
mistaken, there's an environment variable to request elision by
default, and this would DANGEROUSLY break applications using
PTHREAD_MUTEX_NORMAL. Thus, I think this is an issue that needs to be
resolved before merge, or else the env var to request elision needs to
be removed.
Rich