This is the mail archive of the
mailing list for the GCC project.
Re: [committed] Use __kernel_cmpxchg for __sync_lock_release
- From: John David Anglin <dave dot anglin at bell dot net>
- To: Mikael Pettersson <mikpelinux at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, ramana dot radhakrishnan at arm dot com, richard dot earnshaw at arm dot com
- Date: Fri, 18 Jul 2014 10:37:49 -0400
- Subject: Re: [committed] Use __kernel_cmpxchg for __sync_lock_release
- Authentication-results: sourceware.org; auth=none
- References: <BLU436-SMTP97BE92D7629BBF76B5D07697F40 at phx dot gbl> <21449 dot 1231 dot 812618 dot 674579 at gargle dot gargle dot HOWL>
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
> 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.
John David Anglin email@example.com