[committed] Use __kernel_cmpxchg for __sync_lock_release

John David Anglin dave.anglin@bell.net
Fri Jul 18 14:46:00 GMT 2014


On 7/18/2014 7:28 AM, Mikael Pettersson wrote:
> John David Anglin writes:
>   > Because the atomic sync functions in config/pa/linux-atomic.c are not
>   > lock free, we need to use
>   > __kernel_cmpxchg for the __sync_lock_release.  This was found in
>   > glibc's pthread_spin_unlock
>   > implementation.
>   >
>   > Tested on hppa-unknown-linux-gnu.  Committed to trunk.
>
> It seems to me that ARM's linux-atomic.c has the same problem.
> CC:ing some ARM folks for clarification.
It might.  However, the issue is very subtle and may be parisc specific.

Carlos O'Donnel and I had a long discussion about it and couldn't come
to a clear understanding as to how the race occurs.  However, without
changing the release used in glibc for the pthread_spin_unlock operation,
the spin lock tests in the kyotocabinet testsuite would consistently fail.

Dave

-- 
John David Anglin    dave.anglin@bell.net



More information about the Gcc-patches mailing list