This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCHv3] PowerPC: Fix a race condition when eliding a lock
- From: Peter Bergner <bergner at vnet dot ibm dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>, carlos at redhat dot com, triegel at redhat dot com, libc-alpha at sourceware dot org, munroesj at linux dot vnet dot ibm dot com, "Paul E. Murphy" <murphyp at linux dot vnet dot ibm dot com>
- Date: Tue, 01 Sep 2015 16:43:06 -0500
- Subject: Re: [PATCHv3] PowerPC: Fix a race condition when eliding a lock
- Authentication-results: sourceware.org; auth=none
- References: <55D742D3 dot 9050600 at redhat dot com> <1440439895-11812-1-git-send-email-tuliom at linux dot vnet dot ibm dot com> <1441136302 dot 5089 dot 182 dot camel at otta> <55E60E88 dot 50104 at linaro dot org>
On Tue, 2015-09-01 at 17:46 -0300, Adhemerval Zanella wrote:
> On 01-09-2015 16:38, Peter Bergner wrote:
> > /* Definitions used for TEXASR Failure code (bits 0:6), they need to be even
> > because tabort. always sets the first bit. */
[snip]
> Indeed the 'odd' comment does not make sense and we should just remove it
> (I misread texasr definition). My initial idea was define some codes
> that set the persistent failures and some that do not. I think I best
> approach would be:
>
> /* tabort will set TEXASR(0:31) = ((_ABORT_LOCK_BUSY & 0xff) << 24) | 0x1
> and the TEXASR persistent bit is bit 25 (32-7). Only the syscall
> code means a persistent error that should trigger a default lock
> acquisition. */
> #define _ABORT_SYSCALL 0x1 /* Syscall issued. */
> #define _ABORT_LOCK_BUSY 0x2 /* Lock already used. */
> #define _ABORT_NESTED_TRYLOCK 0x4 /* Write operation in trylock. */
So according to this, only the syscall is deemed persistent.
> I think we can use '__builtin_tabortwci' since the transactional aborts
> here are not meant to be persistent (the syscall one are done in syscall
> wrappers).
If we decide that these uses of the explicit tabort*s are really
to be treated as not persistent, then I agree we could use the
conditional tabort[wd]c[i] instructions, but it seems Paul thinks
otherwise. I guess we should let Paul describe why.
Peter