JDK-8230565 : ZGC: Redesign C2 load barrier to expand on the MachNode level
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 14
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2019-09-04
  • Updated: 2024-02-06
  • Resolved: 2019-10-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13 JDK 14
13.0.2Fixed 14 b18Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description
For many years we have expanded load barriers in the C2 sea of nodes. It has been a constant struggle to keep up with bugs due to optimizations breaking our barriers. One particular pain point that has never been handled quite right up until now, is dealing with safepoints ending up between a load and its load barrier.

In the end, our barrier is only a conditional branch to a slow path, so there is really nothing that the optimizer can do to help us make that better. But it has many creative ways of breaking our GC invariants.

I think we have finally had enough of this, and want to move the barrier expansion to the MachNode level instead. This way, we can finally put an end to the load and its load barrier being separated (and related even more complicated issues for atomics).
Comments
The bug caused a lot of failures, not reproduced anymore.
31-01-2020

Fix Request (13u): This fix significantly improves stability of ZGC, or more specifically ZGC load barriers generated by C2. It resolves a number of issues related to how safepoints interact with C2 load barriers. It has been tested quite heavily and proven to work well in JDK 14. The risk should be low, as the the back port was trivial, but not completely clean and required manual merge to resolve 4 simple conflicts. The back port has been tested as follows: - Tier1-3 on all Oracle platforms. - Tier1-6 on Linux/x64. - Multiple iterations of gc-test-suite on Linux/x64. - Builds on Linux/AArch64. Link to back port review thread: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2019-October/035470.html
15-10-2019

URL: https://hg.openjdk.java.net/jdk/jdk/rev/d376d86b0a01 User: eosterlund Date: 2019-10-09 13:03:37 +0000
09-10-2019

Please uncomment 24H testing commented by JDK-8231268.
20-09-2019