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][BZ 18743] PowerPC: Fix a race condition when eliding a lock


On Fri, 2015-08-21 at 12:19 -0300, Tulio Magno Quites Machado Filho wrote:
> Peter Bergner <bergner@vnet.ibm.com> writes:
> > I completely agree we need a barrier here, so I will fix that.  The question
> > I'm starting to wonder, is do we need more than just a memory barrier or
> > do we need a complete optimization barrier, so no code (even scalar code)
> > will move past the __builtin_tbegin() (and other HTM builtins)?
> > ...
> > observable if one or more of the transactions succeeds.  Torvald,
> > Adhemerval and Tulio, do you guys agree with that assessment?
> 
> I agree with you.
> The compiler shouldn't move instructions that affect memory or any of the
> checkpointed registers.

Interestingly, Intel seems to have a similar issue:

    https://gcc.gnu.org/PR63672
    https://gcc.gnu.org/ml/gcc-patches/2014-10/msg02999.html

..although, Andi only tried adding memory barriers to the builtins
and not full optimization barriers.  It seems the above patch never
made it into trunk.

Peter



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