8383421: ZGC: Problematic interactions between JVMTI_EVENT_SAMPLED_OBJECT_ALLOC and clone#31149
Open
xmas92 wants to merge 3 commits into
Open
8383421: ZGC: Problematic interactions between JVMTI_EVENT_SAMPLED_OBJECT_ALLOC and clone#31149xmas92 wants to merge 3 commits into
JVMTI_EVENT_SAMPLED_OBJECT_ALLOC and clone#31149xmas92 wants to merge 3 commits into
Conversation
|
👋 Welcome back aboldtch! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This changes our runtime clone barriers to unconditionally handle tenured destination objects.
We already had a solution for object arrays as they were something ZGCs own allocator could tenure, however we assumed no safepoints for normal object clones. However because of
JVMTI_EVENT_SAMPLED_OBJECT_ALLOCarbitrary java code may be ran between the allocation and the clone barrier.This patch creates a lock-step iterator, which iterates over the object, copies everything between the oops incrementally and does the proper load, and store barriers.
The only thing the implementation currently rely on is that our
oop_oop_iterateiterator visits the fields or elements in address order, which I do not see changing, but is currently not an explicit contract but an implementation detail.The initial implementation used this new construction for tenured object clone. By the fact is that the new cloner can handle cloning any object with the same or better overhead than the three different implementations. So added a commit which generalised and uses this cloner for all objects: e7e4de6
Also added a
JVMTI_EVENT_SAMPLED_OBJECT_ALLOCreproducer, which verifies that we can handle tenured object and object array clones.Currently running testing.
Progress
Issue
JVMTI_EVENT_SAMPLED_OBJECT_ALLOCandclone(Bug - P2)Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31149/head:pull/31149$ git checkout pull/31149Update a local copy of the PR:
$ git checkout pull/31149$ git pull https://git.openjdk.org/jdk.git pull/31149/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 31149View PR using the GUI difftool:
$ git pr show -t 31149Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31149.diff
Using Webrev
Link to Webrev Comment