RFR: 8273122: ZGC: Load forwarding entries without acquire semantics

Aleksey Shipilev shade at openjdk.java.net
Tue Aug 31 14:09:35 UTC 2021


On Tue, 31 Aug 2021 11:25:46 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

> Given of course, that consume actually does do something other than to just bind to acquire.

Today, both GCC trunk and Clang trunk on ARM64 lift `consume` to `acquire`, see https://godbolt.org/z/7jxohsWE1 -- so that path is still unhappy.

After spending a fun day in this particular rabbit hole, I tentatively think we are safer leaving the `acquire`-in-lieu-of-`consume` in. In new revision of #2496, we do that for Shenandoah. I think relocation phase where forwardings are changing concurrently can subsume the cost of `acquire`. #2496 also tries to optimize the Shenandoah paths that are penalized by `acquires` unnecessarily: heap updates after relocations are done. Maybe a similar partial relaxation would be possible for ZGC, e.g. for concurrent mark that does fixups.

The reason why I say "for safety" is because I think I see odd C++ MM cases where not acquiring the fwdptr breaks the apparent release-order / release-acquire transitivity. (Don't ask for details yet, still working that out... and not even sure "consume" fixes it.) It seems to be C++ only problem, as herd7 examples for AArch64 and Power behave like we want. So that one is not necessarily a concern for a hardware-centric low-level not-your-father's-C++ code, but I wonder if we even want to risk it.

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

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



More information about the hotspot-gc-dev mailing list