-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8312749: Generational ZGC: Tests crash with assert(index == 0 || is_power_of_2(index)) #15288
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 rcastanedalo! A progress list of the required criteria for merging this PR into |
/contributor add @stefank |
/contributor add @fisk |
@robcasloz |
@robcasloz |
@robcasloz 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 /label pull request command. |
/label add hotspot-compiler |
/label add hotspot-gc |
@robcasloz |
@robcasloz |
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.
Looks good to me!
@robcasloz 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 271 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.
If I understand it correctly, much of the diff is to ensure that ArrayCopyNode::make
(in BarrierSetC2::clone
) gets the correct value for the length
arg, calculated as align_up(array-length * elem-size, word-size) / word-size
.
I wonder if it's possible to pass the actual array length (#slots) as length
and move the merge-bytes-to-words-copying optimization to a lower level, e.g. inside conjoint_jbytes
. Ofc, BarrierSetC2::clone_at_expansion
and its derived siblings need to be adjusted accordingly, e.g. to use the actual elem-type.
(Preexisting: having ArrayCopyNode
to cover both array and instance cloning hinders the readability, IMO.)
Thanks for reviewing, Tobias! |
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.
Thanks for reviewing, Vladimir! |
Thanks for looking at this, Albert! I agree that the code could benefit from some clean-up, and postponing the merge-bytes-to-words-copying optimization to at least BarrierSetC2::clone_at_expansion() is worth exploring. However, your suggested refactoring would not be trivial, so I suggest to integrate this fix as-is and address the simplification in a separate RFE. Please let me know if you agree, and, if so, I will create a separate RFE for your suggestion. |
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 suggest to integrate this fix as-is and address the simplification in a separate RFE
Sounds reasonable.
Thanks, Albert! I created JDK-8314994 to capture your suggestions, please feel free to edit/extend the description if needed to reflect better your idea. |
/integrate |
Going to push as commit 002b594.
Your commit was automatically rebased without conflicts. |
@robcasloz Pushed as commit 002b594. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This changeset ensures that the array copy stub underlying the intrinsic implementation of
Object.clone
only copies its (double-word aligned) payload, excluding the remaining object alignment padding words, when a non-defaultObjectAlignmentInBytes
value is used. This prevents the specialized ZGC stubs forObject[]
array copy from processing undefined object alignment padding words as valid object pointers. For further details about the specific failure, see initial analysis by Erik Österlund and Stefan Karlsson and comments in the regression test included in this changeset.As a side-benefit, the changeset simplifies the array size computation logic in
GraphKit::new_array()
by decoupling computation of header size and alignment padding size.Testing
Functionality
Performance
Tested performance on the following set of OpenJDK micro-benchmarks, on linux-x64 (for both G1 and ZGC, using different ObjectAlignmentInBytes values):
openjdk.bench.java.lang.ArrayClone.byteClone
openjdk.bench.java.lang.ArrayClone.intClone
openjdk.bench.java.lang.ArrayFiddle.simple_clone
openjdk.bench.java.lang.Clone.cloneLarge
openjdk.bench.java.lang.Clone.cloneThreeDifferent
No significant regression was observed.
Progress
Issue
Reviewers
Contributors
<stefank@openjdk.org>
<eosterlund@openjdk.org>
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15288/head:pull/15288
$ git checkout pull/15288
Update a local copy of the PR:
$ git checkout pull/15288
$ git pull https://git.openjdk.org/jdk.git pull/15288/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15288
View PR using the GUI difftool:
$ git pr show -t 15288
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15288.diff
Webrev
Link to Webrev Comment