[aarch64-port-dev ] Question about JVM option "-XX:+UseBarriersForVolatile" usage in aarch64.
Ningsheng Jian
ningsheng.jian at arm.com
Fri Apr 3 02:30:18 UTC 2020
On 4/3/20 10:03 AM, Nick Gasson wrote:
> On 04/02/20 21:22 pm, Andrew Dinn wrote:
>> One reason for having this switch was to provide a comparator for our
>> scheme to implement the Java volatile accesses using ldar/stlr. That
>> translation scheme avoids a dmb after the stlr allowing the value being
>> written to be committed lazily while still providing the critical
>> guarantee that prior writes are committed before it gets committed. The
>> switch ensures we can fall back to a 'reference' implementation based on
>> dmbs that, amongst other things, enforces immediate commit of the
>> volatile write after commit of its predecessors.
>>
>> By removing support we lose the ability to test cases where
>> synchronization errors occur with our scheme by switching to the
>> 'standard' model. That may still be useful for finding bugs (current or
>> newly injected) in our translation and, indeed, in new HW.
>
> OK, but keeping it is not without cost. If UseBarriersForVolatile is to
> have value as a reference implementation we need to expend effort to
> test it and fix any bugs that arise from changes to other parts of the
> code (see Xiaohong's original mail).
>
>
Yes, if the "reference" implementation is not widely used and tested, it
might be buggy and misleading. I know that when Xiaohong was working on
similar part on Graal [1], she spent a lot of time tracing the
UseBarriersForVolatile issue in hotspot vm. So I agree with Nick and
trend to not maintain this implementation.
[1] https://github.com/oracle/graal/pull/2181
Thanks,
Ningsheng
More information about the aarch64-port-dev
mailing list