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: [RFC] [PATCH] powerpc: Fix missing barriers in atomic_exchange_and_add_{acq,rel}


On 25-11-2014 13:39, Torvald Riegel wrote:
> On Tue, 2014-11-25 at 13:07 -0200, Adhemerval Zanella wrote:
>> Hi Torvald,
>>
>> On 21-10-2014 17:54, Torvald Riegel wrote:
>>> 				      \
>>>    })
>>> +#define atomic_exchange_and_add_acq(mem, value) \
>>> +  ({									      \
>>> +    __typeof (*(mem)) __result2;					      \
>>> +    __result2 = atomic_exchange_and_add (mem, value);			      \
>>> +    atomic_read_barrier ();						      \
>>> +    __result2;		
>> Although it is not wrong by using a 'atomic_read_barrier' (lwsync), it adds a more 
>> expensive synchronization than required (isync).  I would prefer if we use the
>> already defined __arch_compare_and_exchange_val_[32|64]_[acq|rel] operations on powerpc.
> That's fine with me.  Do you want to go adapt and commit the patch
> (given that you can test this easily I guess), or should I?
>
I will do it, thanks.


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