-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8373116: Genshen: arraycopy_work should be always done for arrays in old gen during young concurrent marking #28669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
👋 Welcome back xpeng! A progress list of the required criteria for merging this PR into |
|
@pengxiaolong This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 25 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
@pengxiaolong The following labels will be automatically applied to this pull request:
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. |
|
/issue add JDK-8372498 |
|
@pengxiaolong |
|
@pengxiaolong |
|
/issue add JDK-8372498 |
|
@pengxiaolong |
Webrevs
|
|
After apply the proposed patch, the jvm crash do not observed by run the test 1000 times. But there is one "java.lang.OutOfMemoryError: Java heap space" test fails observed. |
Thank you Sendao for the test and verification! The OOM should be an unrelated issue, I'm not sure if there is open bug for it or not, please create a new one if there isn't. |
|
earthling-amzn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue, as I understand it, is that mutators are racing with the concurrent remembered set scan. If a mutator changes a pointer covered by a dirty card, it could prevent the remembered set scan from tracing the original object that was reachable at the beginning of marking. Since we may not be marking old, we cannot rely on the TAMS for objects in old regions and must unconditionally enqueue all of the overwritten pointers in the old array. Should we only do this when young marking is in progress? Perhaps we should have a version of arraycopy_work that only enqueues young pointers here?
I don't think it is related the any racing on remembered set, I got some GC logs from which I think we may know how it actually happens.
Because the heap was already corrupted, it doesn't matter the last GC is full GC or not, it will alway crash when there is read/write on the object array which is gone. |
|
At step 2, we have an element in the old array pointing to young, correct? Why is it not represented in the remembered set at the beginning of young mark? If it is because the old -> young pointer was created after init mark, then the young pointer was either reachable when mark started, or it was created after mark started. Either way, the young pointer should have been found without this SATB modification. Unless, it was in the remembered set, but it didn't get scanned because a mutator modified it before it was scanned. |
array copy involves two array object, src and dst. The dst array is an old array, the src may not be an old, it could be young. |
earthling-amzn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We talked offline. The assertion must be weakened to account for dirty write cards because the young pointer could be put in the old array after init mark. We cannot expect the read card to be dirty in this case.
…current young marking is in progress
Chasing the root cause of JDK-8372498, I have narrowed down root cause to the commit f8cf9ca
It is caused by the behavior change from follow code:
Original:
New:
With the new STAB barrier code for arraycopy_marking, if is it young GC and the array is in old region, but array is above TAMS(Old GC may not be started, TAMS of old region is not captured), arraycopy_work won't be applied anymore, so we may have missed some pointers in SATB in such case during concurrent young marking.
Test
Progress
Issues
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28669/head:pull/28669$ git checkout pull/28669Update a local copy of the PR:
$ git checkout pull/28669$ git pull https://git.openjdk.org/jdk.git pull/28669/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28669View PR using the GUI difftool:
$ git pr show -t 28669Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28669.diff
Using Webrev
Link to Webrev Comment