Skip to content

Conversation

earthling-amzn
Copy link
Contributor

@earthling-amzn earthling-amzn commented Oct 8, 2025

There are certain code paths in Shenandoah's generational mode that need to know which generation is being collected, but it is not possible to pass this information on the stack (barriers, for example). To address this, we introduced an _active_generation member in ShenandoahHeap. Over time, the usage of this field grew beyond its intended purpose and we began to have issues where not all threads would see a consistent value for this field. To address this issue, we added another field _gc_generation which was only meant to be used by GC threads. At this point, we have three different ways to determine which generation is being collected: the active generation, the gc generation, and the usual function parameters and member fields of the gc components. This PR removes _gc_generation and reduces the use of _active_generation to only those places where it is not possible to get this information from other means (barriers, mostly). All GC components that can have this information passed through function calls, now do so.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8369068: GenShen: Generations still aren't reconciled assertion failure (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27703/head:pull/27703
$ git checkout pull/27703

Update a local copy of the PR:
$ git checkout pull/27703
$ git pull https://git.openjdk.org/jdk.git pull/27703/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27703

View PR using the GUI difftool:
$ git pr show -t 27703

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27703.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 8, 2025

👋 Welcome back wkemper! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Oct 8, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added hotspot-gc hotspot-gc-dev@openjdk.org shenandoah shenandoah-dev@openjdk.org labels Oct 8, 2025
@openjdk
Copy link

openjdk bot commented Oct 8, 2025

@earthling-amzn The following labels will be automatically applied to this pull request:

  • hotspot-gc
  • shenandoah

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 8, 2025
@mlbridge
Copy link

mlbridge bot commented Oct 8, 2025

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-gc hotspot-gc-dev@openjdk.org rfr Pull request is ready for review shenandoah shenandoah-dev@openjdk.org

1 participant