[PATCH] x86: Optimize atomic_compare_and_exchange_[val|bool]_acq [BZ #28537]
Andreas Schwab
schwab@linux-m68k.org
Wed Nov 3 17:17:32 GMT 2021
On Nov 03 2021, Arjan van de Ven via Libc-alpha wrote:
> What the patch does is check non-atomic first if the actual atomic operation has
> a chance of working. if it has a chance, the actual normal atomic operation is done as
> before. But if non-atomic read already tells you the cmpxchg has no chance to succeed, it errors
> out early.
But if the compiler keeps reusing the same cached value it may conclude
that the CAS _never_ has a chance to succeed.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
More information about the Libc-alpha
mailing list