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: [PATCH] Fix elision in nested trylock.


> 1) An xabort outside of a transaction must be fast.  If it's slow for
> some reason, this would slow down locks for which we could but don't use
> elision.

An abort that is not aborting is fairly fast (a few cycles)

> What was wrong
> with "if (*try_lock > 0) _xabort(_ABORT_LOCK_BUSY);" (except perhaps a
> missing builtin_expect)? 

The check adds unnecessary overhead.

> Finally, this only works for HTMs for which
> xabort outside a transaction is a no-op.

The code is TSX specific and TSX defines xabort to a no-op outside
transactions.

I believe it's also fairly clear to anyone familiar with the TSX
specification, and if they are not they should not touch this code.

-Andi


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