This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/9] Add the low level infrastructure for pthreads lockelision with TSX
On Wed, 2013-01-23 at 09:16 +0100, Florian Weimer wrote:
> On 01/22/2013 10:39 PM, Andi Kleen wrote:
>
> > + /* When this could be a nested trylock that is not explicitely
> > + declared an elided lock abort. This makes us follow POSIX
> > + paper semantics. */
> > + if (upgraded)
> > + _xabort (0xfd);
> > +
> > + if ((status = _xbegin()) == _XBEGIN_STARTED)
> > + {
> > + if (*futex == 0)
> > + return 0;
> > +
> > + /* Lock was busy. Fall back to normal locking.
> > + Could also _xend here but xabort with 0xff code
> > + is more visible in the profiler. */
> > + _xabort (0xff);
> > + }
>
> Shouldn't 0xfd, 0xff be #defines or enum constants?
Agreed.
Andi, you've previously said that those constants would become part of
an ABI. Is there any common header / specification / ... for this ABI
yet? Where do you think will this get specified properly? Or will this
remain a convention?
This is also somewhat related to the approach you took for txn-assert.
Those constants (eg, 0xff) are already used in GCC libitm too, so it
might make sense to find a common place for them at some point in time..
Torvald