This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC] [PATCH] powerpc: Fix missing barriers in atomic_exchange_and_add_{acq,rel}
- From: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Thu, 20 Nov 2014 09:07:47 -0200
- Subject: Re: [RFC] [PATCH] powerpc: Fix missing barriers in atomic_exchange_and_add_{acq,rel}
- Authentication-results: sourceware.org; auth=none
- References: <1413921274 dot 8483 dot 65 dot camel at triegel dot csb> <1416481466 dot 1771 dot 3 dot camel at triegel dot csb>
On 20-11-2014 09:04, Torvald Riegel wrote:
> On Tue, 2014-10-21 at 21:54 +0200, Torvald Riegel wrote:
>> On powerpc, atomic_exchange_and_add is implemented without any barriers.
>> However, atomic_exchange_and_add_acq and atomic_exchange_and_add_rel
>> (which supposedly should have acquire / release barrier semantics) both
>> fall back to atomic_exchange_and_add if they are not defined (see
>> include/atomic.h). I have not reviewed existing code to see whether
>> this would indeed cause a bug, but this lack of barriers likely is a
>> (future) fault, and prevents any use of
>> atomic_exchange_and_add_{acq,rel} that actually rely on the barrier
>> semantics. Therefore, this patch defines
>> atomic_exchange_and_add_{acq,rel} using atomic_read_barrier /
>> atomic_write_barrier.
>>
>> I have NOT tested this. Can somebody who cares about powerpc please
>> have a look and test this? Thanks!
> Ping.
>
>
Sorry, I missed it on my radar. I will review and test today, thanks.