[aarch64-port-dev ] AArch64: Neoverse N1 atomic operations and -moutline-atomics
Andrew Haley
aph at redhat.com
Tue May 19 14:27:48 UTC 2020
On 5/19/20 11:45 AM, Nick Gasson wrote:
> On 05/18/20 17:53 PM, Andrew Haley wrote:
>>
>>> Question is whether it's best to enable this by default in OpenJDK or
>>> leave it to downstream distributions to decide?
>>
>> I don't really understand why there is a conditional branch there.
>> They could just do the test at startup and patch the code. Maybe it'd
>> hurt DSO startup time or something? Maybe they don't like the idea of
>> temporarily enabling exec privilege on a page of writable data.
>
> I asked internally and it's basically the reasons you mention above,
> plus patching could cause excessive copy-on-writes of the code pages.
>
> The other way to do it is to build one libjvm.so without LSE support and
> then a separate atomics/libjvm.so with -march set to enable the LSE
> instructions. Then ld.so will load the appropriate library based on the
> hwcaps. This should give the best performance but the build time and
> package size balloons.
Hmm, no. :-)
I think we'd better leave it as it is. I've done a few experiments
with the Neoverse N1 and it's all rather murky: it's not clear to me
that LSE atomics are an overall win in the Java context. We don't make
heavy use of pthread mutexes except when we've decided to block, in
which case the execution time is completely dominated by the cost of a
system call.
--
Andrew Haley (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the aarch64-port-dev
mailing list