-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8372513: Shenandoah: ShenandoahMaxRegionSize can produce an unaligned heap alignment #28492
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 stefank! A progress list of the required criteria for merging this PR into |
|
@stefank 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 4 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 |
jsikstro
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.
I think this looks good.
|
I realized that having an unconstrained flag like this can cause overflows and asserts because of that. If we want to fix that we could do something like the following: Then running Will give this error message instead of an assert: |
shipilev
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.
Yes, this is the correct fix. Thanks for handling this!
|
Thanks, Aleksey! What do you think about the issue with an extreme user-specified value as described in: Do you want that change or not? |
Feel free to submit a bug and let Shenandoah folks handle it. This PR stands on its own, and I think it unblocks some of the pending work, so ship it. |
|
Sounds good. Thanks again! |
|
/integrate |
|
Going to push as commit 5291e1c.
Your commit was automatically rebased without conflicts. |
While rewriting some of the heap size initialization code we hit a corner-case where the setting of
ShenandoahMaxRegionSizeto something that isn't a power-of-2 will hit an assert inmax_heap_for_compressed_oops.When running with:
The following code:
triggers:
because
_conservative_max_heap_alignmentis not a power-of-2.This happens because Shenandoah's
conservative_max_heap_alignment()returns a potentially unaligned
ShenandoahMaxRegionSizevalue.I propose a small fix to adjust
alignto be a power-of-2. I've also added an earlier assert about this inset_conservative_max_heap_alignmentand added an additional test-case in TestRegionSizeArgs.javaWDYT, is this an OK fix for this corner-case?
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28492/head:pull/28492$ git checkout pull/28492Update a local copy of the PR:
$ git checkout pull/28492$ git pull https://git.openjdk.org/jdk.git pull/28492/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28492View PR using the GUI difftool:
$ git pr show -t 28492Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28492.diff
Using Webrev
Link to Webrev Comment