8375359: Improve GC serviceability init staging #29254
Open
+89
−52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As per docs,
CollectedHeap::post_initializeis for doing inits that should be done before general allocations are accepted. Currently, serviceability layer initialized there via the call toCollectedHeap::initialize_serviceability. This bug shows that afterCollectedHeap::post_initializereturns, the rest of the serviceability layer had not been fully initialized yet. But GC code might assume general allocation path works at that point! So if that allocation path reports anything to the serviceability layer, it could encounter not yet fully initialized serviceability support and fail.This readily manifests in improved Epsilon stress test. Improved test fails pretty consistently on my machines, and serves as a good regression test.
So the fix is to peel off serviceability initialization from post-init stage, and do it separately, before going (and finishing)
post_initialize. Conveniently, we are nearly there, and "just" need to touch up a few things inuniverse_post_init().Additional testing:
gc/epsilon/TestInitAllocs.java, 10xhotspot_gcProgress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/29254/head:pull/29254$ git checkout pull/29254Update a local copy of the PR:
$ git checkout pull/29254$ git pull https://git.openjdk.org/jdk.git pull/29254/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 29254View PR using the GUI difftool:
$ git pr show -t 29254Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/29254.diff
Using Webrev
Link to Webrev Comment