[PATCH RFC 2/2] arm64: atomics: add optimization support for implementations using near atomics

Yicong Yang yangyccccc at gmail.com
Tue Sep 23 08:31:05 PDT 2025


On 2025/9/23 18:04, Will Deacon wrote:
> On Fri, Sep 19, 2025 at 05:17:47PM +0800, Yicong Yang wrote:
>> From: Yicong Yang <yangyicong at hisilicon.com>
>>
>> Atomic operations can be implemented in the CPU (near atomics) or
>> in the interconnect or at the Subordinate holding the data (far
>> atomics) [1]. The former one can be further optimized by prefetching
>> the destination prior to the atomic operations, similar to the
>> optimization for LL/SC operations mentioned in
>> commit 0ea366f5e1b6 ("arm64: atomics: prefetch the destination word for write prior to stxr")
> Sorry, but I'm strongly against this. The CPU needs to do better if
> the system is configured for near atomics.

got it, then let's leave it to the CPU/hardware guys :) thanks for sharing the opinion.

thanks.




More information about the linux-arm-kernel mailing list