JDK-8173211 : G1: Enqueuing dirty cards during reference enqueuing in phase 3 does not scale
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Not an Issue
  • Submitted: 2017-01-23
  • Updated: 2019-03-22
  • Resolved: 2019-03-22
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.
Other
tbdResolved
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
For G1 there is a problem with enqueuing references in phase 3. That enqueue applies the barrier set's write_ref_field to the discovered links being added to the pending list. If the reference is young, this isn't a problem because the write barrier doesn't need to do anything in that case. But if the reference is old, it's going to record a dirty card, and that's going to be in the shared global DirtyCardQueue, since the call is from a non-Java thread. So a locking DCQ.enqueue per reference, and severe lock contention when parallelized. One possiblity might be a special purpose variant of write_ref_field for use here, with most collectors just forwarding to their normal write_ref_field implementation, but G1 using per-worker DCQs. 
Comments
No longer an issue. Because of JDK-8219613, the relevant write barrier invocations now use the per-worker-thread dirty card queues, eliminating the contention on the shared queue.
22-03-2019

JDK-8202017 removed the enqueuing phase, however the bottleneck with the DCQ still exists in phase3 of reference processing.
08-05-2018

The ParScanThreadState already has per-worker dcq embedded in it but the problem is that when we are in write_ref_field in the G1SATB-BS we can't find it
14-09-2017