-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
8-shenandoah, 11.0.9, 16, 17
Shenandoah carriers forwardee information in object's mark word. Installing the new mark word is effectively "releasing" the object copy, and reading from the new mark word is "acquiring` that object copy.
For the forwardee update side, Hotspot's default for atomic operations is memory_order_conservative, which emits two-way memory fences around the CASes at least on AArch64 and PPC64. This seems to be excessive for Shenandoah forwardee updates, and "release" is enough.
For the forwardee load side, we need to guarantee "acquire". We do not do it now, reading the markword without memory semantics. It does not seem to pose a practical problem today, because GC does not access the object contents in the new copy, and mutators get this from the JRT-called stub that has enough barriers. It still should be cleaner to "acquire" the mark on load to avoid surprises.
It would not help AArch64 much untilJDK-8261579 actually implements acq/rel.
For the forwardee update side, Hotspot's default for atomic operations is memory_order_conservative, which emits two-way memory fences around the CASes at least on AArch64 and PPC64. This seems to be excessive for Shenandoah forwardee updates, and "release" is enough.
For the forwardee load side, we need to guarantee "acquire". We do not do it now, reading the markword without memory semantics. It does not seem to pose a practical problem today, because GC does not access the object contents in the new copy, and mutators get this from the JRT-called stub that has enough barriers. It still should be cleaner to "acquire" the mark on load to avoid surprises.
It would not help AArch64 much until
- duplicates
-
JDK-8273127 Shenandoah: relax update references memory ordering even more
-
- Closed
-
- is blocked by
-
JDK-8261579 AArch64: Support for weaker memory ordering in Atomic
-
- Resolved
-
- links to
-
Review openjdk/jdk/2496
-
Review(master) openjdk/jdk/2496