JDK-8314329 : AgeTable: add is_clear() & allocation spec, and relax assert to allow use of 0-index slot
  • Type: Task
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 17,21,22,23
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-08-15
  • Updated: 2024-01-30
  • Resolved: 2024-01-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.
JDK 23
23 b07Fixed
Related Reports
Relates :  
Relates :  
Description
I'd like to make a few changes to the AgeTable so as to be able to use it in GenerationalShenandoah.

1. Traditional GCs would count object ages in the age table after incrementing their age, and compute the tenuring threshold following the GC, which they would use in the next minor collection to make tenuring decisions.

Concurrent collectors such as Generational Shenandoah count object ages during the marking phase, using the demographic data to make a tenuring decision at the evacuation that follows the marking, and during which ages of surviving objects are incremented.

The age table has a 0-indexed slot that can be used to record this information, but the assertion that object ages must be greater than 0 was too strong for use cases such as described above.

We should relax the assert to allow collectors such as Generational Shenandoah to use the age table's 0th index.

At the time of this writing, the tenuring threshold computation is bolted into the age table and is specific to stop-world collectors. We can either move the assertion check to that method (which is strictly later than when the original assert may have detected a violation), or move the check into the caller of the age table method where the assertion lives today.

Ref: https://github.com/openjdk/shenandoah/pull/289/files#r1251339431

2. The AgeTable should have an allocation spec, so as to allow it to be allocated independently rather than within a larger structure as is the case currently. In particular, this allows GenerationalShenandoah to track multiple age cohort histories (snapshots) using copies of the AgeTable.

3. For verification of AgeTable preconditions with certain uses, such as described in (2) above, I'd like to add an `is_clear()` method that checks that the AgeTable is clean with no non-zero entries.

Comments
Changeset: df370d72 Author: Y. Srinivas Ramakrishna <ysr@openjdk.org> Date: 2024-01-22 19:51:47 +0000 URL: https://git.openjdk.org/jdk/commit/df370d725e5ae55a05479e8375bf665233ac3e44
22-01-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/17470 Date: 2024-01-17 21:56:44 +0000
17-01-2024