-
Notifications
You must be signed in to change notification settings - Fork 6k
8267188: gc/stringdedup/TestStringDeduplicationInterned.java fails with Shenandoah #5151
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
Conversation
👋 Welcome back zgu! A progress list of the required criteria for merging this PR into |
@zhengyu123 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. |
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.
Looks good to me!
@zhengyu123 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 no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
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.
Looks fine, modulo a few suggestions.
break; | ||
} | ||
} | ||
} | ||
|
||
template <class T, bool CANCELLABLE> | ||
void ShenandoahMark::mark_loop_work(T* cl, ShenandoahLiveData* live_data, uint worker_id, TaskTerminator *terminator) { | ||
template <class T, bool CANCELLABLE,StringDedupMode STRING_DEDUP> |
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.
template <class T, bool CANCELLABLE,StringDedupMode STRING_DEDUP> | |
template <class T, bool CANCELLABLE, StringDedupMode STRING_DEDUP> |
@@ -54,6 +68,7 @@ void ShenandoahMark::do_task(ShenandoahObjToScanQueue* q, T* cl, ShenandoahLiveD | |||
|
|||
if (task->is_not_chunked()) { | |||
if (obj->is_instance()) { | |||
dedup_string<STRING_DEDUP>(obj, req); |
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.
I do wonder if it is faster to first let the closure process the outbound references, and then do dedup for the object? This way, parallel GC workers can do work while we are calling dedup_string
here. This is one of the reasons why old code did dedup check after the queue push. In other words, move this call at the end of this block.
@zhengyu123 this pull request can not be integrated into git checkout JDK-8267188-string-intern
git fetch https://git.openjdk.java.net/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
/integrate |
@zhengyu123 This PR has not yet been marked as ready for integration. |
… into JDK-8267188-string-intern
|
/integrate |
Going to push as commit 7212561. |
@zhengyu123 Pushed as commit 7212561. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Shenandoah currently enqueues deduplication candidates when marks object gray.
However, it can not do so when it scans roots, as it can potentially result lock rank inversion between stack watermark lock and dedup request buffer lock.
As the result, it can not enqueue as many as candidates as it should be able to, I believe JDK-8271834 is due to the same problem. I purpose we switch to enqueue candidates when we mark object black.
We are still not able to enqueue all candidates, only when they have displaced headers or have monitor inflating in progress. Upstream is working on removing displaced headers, we should revisit the logic afterward, or we can choose to deduplicate all string regardless their ages.
Test:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5151/head:pull/5151
$ git checkout pull/5151
Update a local copy of the PR:
$ git checkout pull/5151
$ git pull https://git.openjdk.java.net/jdk pull/5151/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 5151
View PR using the GUI difftool:
$ git pr show -t 5151
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5151.diff