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
8253262: Allocate in DumpRegion is not thread safe #216
Conversation
👋 Welcome back minqi! A progress list of the required criteria for merging this PR into |
@yminqi The following label 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 list. If you would like to change these labels, use the |
This seems okay but isn't dumping done at a safepoint? |
There is case the code is executed in other JavaThread (seen in Finalizer thread) other than the JavaThread which does loading classes and creating symbols. That is before the dump starts. The word 'at dump' seems misleading. |
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.
@yminqi This change now passes all automated pre-integration checks. In addition to the automated checks, the change must also fulfill all project specific requirements After integration, the commit message will be:
Since the source branch of this PR was last updated there have been 39 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 automatic rebasing, please merge ➡️ To integrate this PR with the above commit message to the |
/integrate |
@yminqi Since your change was applied there have been 39 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 12dfe1c. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
It seems to me that the need for locking should be an internal implementation detail of MetaspaceShared::symbol_space_alloc, rather than Symbol operator new. |
I pushed before saw your above comment. The reason for current place is because the following code: |
My comment was made after the integration so no issue there. But I think the monotonicity check also belongs inside MetaspaceShared::symbol_space_alloc |
At CDS dump, the symbols are allocated from _dump_region (DumpRegion) which is global, and not thread safe when executed in JavaThread. Add a lock DumpRegoin_lock to guard symbol allocation from it.
Tests: tier1-4
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/216/head:pull/216
$ git checkout pull/216