RFR: 8253469: ARM32 Zero: replace usages of __sync_synchronize() with OrderAccess::fence

Aleksey Shipilev shade at openjdk.java.net
Tue Sep 22 12:47:00 UTC 2020


In `atomic_bsd_zero.hpp` and `atomic_linux_zero.hpp` there are uses of __sync_synchronize(). However,
`orderAccess_*_zero.hpp` calls the kernel helper, because:

/*
 * ARM Kernel helper for memory barrier.
 * Using __asm __volatile ("":::"memory") does not work reliable on ARM
 * and gcc __sync_synchronize(); implementation does not use the kernel
 * helper for all gcc versions so it is unreliable to use as well.
 */

We need to clean this up to use `OrderAccess::fence()` to gain access to the kernel helper.

Attention @bulasevich.

Testing:
 - [ ] ARM32 Zero jcstress
 - [ ] Mac OS x86_64 Zero jcstress

-------------

Commit messages:
 - 8253469: ARM32 Zero: replace usages of __sync_synchronize() with OrderAccess::fence

Changes: https://git.openjdk.java.net/jdk/pull/298/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=298&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8253469
  Stats: 6 lines in 2 files changed: 2 ins; 0 del; 4 mod
  Patch: https://git.openjdk.java.net/jdk/pull/298.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/298/head:pull/298

PR: https://git.openjdk.java.net/jdk/pull/298


More information about the hotspot-runtime-dev mailing list