JDK-8256280 : Improve locality of PtrQueue instances in G1 thread local data
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 16
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2020-11-12
  • Updated: 2020-12-15
  • Resolved: 2020-12-15
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
Duplicate :  
Relates :  
Description
Currently the two PtrQueue instances for G1 are located in G1's thread local data.

There are a few issues here:
- this means that the members of PtrQueue that the compiled code needs are all over the place and interspersed with other data not required by the compiled code. Another example are the C++ class headers (VMTs) which take away 16 bytes.

- at the moment the last index used by the compiler is already 120 (DirtyCardQueue::_buf) - which for x86 is actually the last index that can be used with short offsets from TLS. So adding anything else will cause suboptimal code generation/density.

- using too large sizes just wastes precious (cache) space

One option could be to move the data that is used by compiled code into an extra data structure (e.g. PtrQueueData, but certainly there are better names) and embed that one.

Minimally these are _buf and _index (i.e. with JDK-8256279 implemented). Only having these however has the problem that actual enqueuing does not know where to put full buffers. This could either be fixed by adding _qset there, or different entry points for the two necessary PtrQueueSets.

There are some setup issues that need to be looked at as now PtrQueue and PtrQueueData reference each other.