-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8299673: Simplify object pinning interactions with string deduplication #11923
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 eosterlund! A progress list of the required criteria for merging this PR into |
|
/contributor add @stefank |
|
@fisk |
|
/contributor add @xmas92 |
|
@fisk |
kimbarrett
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.
Looks good.
|
@fisk 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 7 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
| #include "gc/shared/gcLocker.inline.hpp" | ||
| #include "gc/shared/gcHeapSummary.hpp" |
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.
Sort order
|
Thank you for the reviews, @kimbarrett and @stefank! |
dholmes-ora
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.
Initially I was a bit unsure about the conceptual model here, as I was thinking that pinning is a very general concept, where in fact it only relates to these JNI "critical" functions. So in that sense every GC must support pinning as required by those functions, so this simplification looks very neat. Thanks.
|
Thanks for the review, @dholmes-ora! |
|
/integrate |
|
Going to push as commit 9a36f8a.
Your commit was automatically rebased without conflicts. |
When raw char* String contents are exposed to JNI code, we
Given this sequence we would be in trouble if between 1 and 3, string deduplication changed the value object. Then the pinning and unpinning wouldn't be balanced.
The current approach for dealing with this is to have a bunch of code to guard against deduplication. An alternative simpler solution is to just change step 3 to pass in the same value. We already have enough information available to do that. Then the pinning and unpinning is also balanced, and we don't need to have any special interactions with string deduplication and can decouple these orthogonal concerns.
It's worth noting though that the contract of pin_object now makes it explicit that pinned objects must not be recycled, even if not otherwise reachable. That seems to come naturally for region based pinning, but is worth keeping in mind. The exposed char* might be the only thing referencing the string value when string dedup happens concurrently.
Progress
Issue
Reviewers
Contributors
<stefank@openjdk.org><aboldtch@openjdk.org>Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11923/head:pull/11923$ git checkout pull/11923Update a local copy of the PR:
$ git checkout pull/11923$ git pull https://git.openjdk.org/jdk pull/11923/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 11923View PR using the GUI difftool:
$ git pr show -t 11923Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11923.diff