-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
JDK-8318485: Narrow klass shift should be zero if encoding range extends to 0x1_0000_0000 #16261
Conversation
👋 Welcome back stuefe! A progress list of the required criteria for merging this PR into |
@tstuefe |
@tstuefe |
@tstuefe |
Webrevs
|
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.
Thanks for fixing this. I've tried your patch on the CompressedClassPointers.java test. It also fixes the issue in JDK-8317610. Just have a couple of minor comments.
LogStream ls(lt); | ||
os::print_memory_mappings((char*)base, size, &ls); |
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 saw the above log message as follows:
java -XX:+UnlockDiagnosticVMOptions -XX:CompressedClassSpaceBaseAddress=0xa0000000 -XX:CompressedClassSpaceSize=1g -Xlog:metaspace=debug -Xlog:os+map=trace -Xshare:off -version
[0.001s][info][metaspace] - commit_granule_bytes: 65536.
[0.001s][info][metaspace] - commit_granule_words: 8192.
[0.001s][info][metaspace] - virtual_space_node_default_size: 8388608.
[0.001s][info][metaspace] - enlarge_chunks_in_place: 1.
[0.001s][info][metaspace] - use_allocation_guard: 0.
[0.036s][debug][metaspace] Range [a0000000-e0000000) contains:
[0.036s][debug][metaspace] a0000000-120000000 rw-p 00000000 00:00 0
[0.036s][debug][metaspace]
Error occurred during initialization of VM
CompressedClassSpaceBaseAddress=0x00000000a0000000 given, but reserving class space failed.
Is it easy to get rid of the blank line before the line begins with "Error occurred..."?
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.
Okay.
// Expecting base=0, shift=0 | ||
test(4 * G - 128 * M, 128 * M, 0, 0); | ||
|
||
// add more... |
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 following works on my linux dev host.
test(0xa0000000L, 1 * G, 0, 0);
test(0x100000000L, 2 * G, 0, 3);
Maybe you can consider adding them to the test?
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'd rather expand this in a separate RFE. Second one should work on all platforms, but I am not 100% sure some would encode this with base=4g shift=0 instead. Probably not, but it is better to stay focused on one issue. Makes also for clearer backporting.
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.
That's fine.
Thanks @calvinccheung . I fixed the output as requested. |
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.
Thanks for the update. It looks good.
@tstuefe 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 73 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 |
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.
LGTM
Thanks @calvinccheung and @iklam . /integrate |
Going to push as commit 5ba9705.
Your commit was automatically rebased without conflicts. |
See JBS issue.
The real fix, trivial, is the comparison change in compressedKlass.cpp.
This patch then also adds a test that checks that for a given (forced) class space location the VM chose the correct encoding scheme. In this case, if class space nestles below and ends at 4G, we should use a shift of 0.
The test can be easily extended to test more narrow Klass encoding schemes. Note that the test is skipped if the VM could not map at the expected address to begin with.
Finally, to analyze test errors, I print out the mappings at the force address if metaspace logging is debug.
Tests: manual, GHA. x86 GHA errors unrelated.
/label remove core-libs
/label remove hotspot
/label add hotspot-runtime
Attention @iklam and @calvinccheung
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16261/head:pull/16261
$ git checkout pull/16261
Update a local copy of the PR:
$ git checkout pull/16261
$ git pull https://git.openjdk.org/jdk.git pull/16261/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16261
View PR using the GUI difftool:
$ git pr show -t 16261
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16261.diff
Webrev
Link to Webrev Comment