Skip to content
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

8295657: SA: Allow larger object alignments #10762

Closed
wants to merge 4 commits into from

Conversation

shipilev
Copy link
Member

@shipilev shipilev commented Oct 19, 2022

Found this when working on JOL support (CODETOOLS-7903364). If you try to attach to VM running with -XX:ObjectAlignmentInBytes=32, then SA would fail with:

Caused by: java.lang.RuntimeException: Object alignment 32 not yet supported
at jdk.hotspot.agent/sun.jvm.hotspot.runtime.VM.<init>(VM.java:510)
at jdk.hotspot.agent/sun.jvm.hotspot.runtime.VM.initialize(VM.java:544)
at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.setupVM(HotSpotAgent.java:444)

This code was added by JDK-6916623, but I don't see a reason why it should only handle 8 and 16 byte alignment.

Additional testing:

  • New regression test
  • Linux x86_64 fastdebug serviceability/sa, with the combination of:
    • different -XX:ObjectAlignmentInBytes=: 8, 16, 32, 64, 128, 256
    • different GCs: Serial, Parallel, G1
  • Linux x86_64 fastdebug sun/tools/jhsdb, with the combination of:
    • different -XX:ObjectAlignmentInBytes=: 8, 16, 32, 64, 128, 256
    • different GCs: Parallel, G1

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10762/head:pull/10762
$ git checkout pull/10762

Update a local copy of the PR:
$ git checkout pull/10762
$ git pull https://git.openjdk.org/jdk pull/10762/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10762

View PR using the GUI difftool:
$ git pr show -t 10762

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10762.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 19, 2022

👋 Welcome back shade! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 19, 2022
@openjdk
Copy link

openjdk bot commented Oct 19, 2022

@shipilev The following label will be automatically applied to this pull request:

  • serviceability

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.

@openjdk openjdk bot added the serviceability serviceability-dev@openjdk.org label Oct 19, 2022
@mlbridge
Copy link

mlbridge bot commented Oct 19, 2022

Webrevs

Copy link
Member

@tstuefe tstuefe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. Curious, how well are all these alignments tested? E.g. do they work with all GCs?

@openjdk
Copy link

openjdk bot commented Oct 19, 2022

@shipilev 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:

8295657: SA: Allow larger object alignments

Reviewed-by: stuefe, cjplummer

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 16 new commits pushed to the master branch:

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 19, 2022
@shipilev
Copy link
Member Author

Looks fine. Curious, how well are all these alignments tested? E.g. do they work with all GCs?

I tested serviceability/sa with default (G1) and all acceptable alignments, seems to work fine. We can run the tests with other GCs, if anyone wants it.

@plummercj
Copy link
Contributor

Looks fine. Curious, how well are all these alignments tested? E.g. do they work with all GCs?

We have gc/TestObjectAlignment.java. I don't see any indication that this test is not run with all GCs.

@plummercj
Copy link
Contributor

The short test isn't really proof that SA works well with these alternate alignments. You really should try running all SA tests with TEST_VM_OPTS=-XX:ObjectAlignmentInBytes=<n> where is something other than 8 or 16.

@shipilev
Copy link
Member Author

The short test isn't really proof that SA works well with these alternate alignments. You really should try running all SA tests with TEST_VM_OPTS=-XX:ObjectAlignmentInBytes=<n> where is something other than 8 or 16.

As I stated in "Additional testing" in the PR description, I did ran serviceability/sa with different alignments. What other tests we should run?

@plummercj
Copy link
Contributor

As I stated in "Additional testing" in the PR description, I did ran serviceability/sa with different alignments. What other tests we should run?

Sorry, I missed that. There are also some SA tests in test/jdk/sun/tools/jhsdb.

@shipilev
Copy link
Member Author

Sorry, I missed that. There are also some SA tests in test/jdk/sun/tools/jhsdb.

Ran those too with different object alignments. I am running tests with different GCs too.

@shipilev
Copy link
Member Author

Ran those too with different object alignments. I am running tests with different GCs too.

Ran with Serial, Parallel, G1. Shenandoah and ZGC have problems with SA tests even with default object alignment, so I skipped those. Serial OOMEs on some tests.

Copy link
Contributor

@plummercj plummercj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@shipilev
Copy link
Member Author

Thanks!

/integrate

@openjdk
Copy link

openjdk bot commented Oct 21, 2022

Going to push as commit dfd2d83.
Since your change was applied there have been 17 commits pushed to the master branch:

  • a345df2: 8280131: jcmd reports "Module jdk.jfr not found." when "jdk.management.jfr" is missing
  • ef62b61: 8295703: RISC-V: Remove implicit noreg temp register arguments in MacroAssembler
  • 6240431: 8295697: Resolve conflicts between serviceability/jvmti and nsk/jvmti shared code
  • 1164258: 8295124: Atomic::add to pointer type may return wrong value
  • d3eba85: 8295414: [Aarch64] C2: assert(false) failed: bad AD file
  • 028e8b3: 8137022: Concurrent refinement thread adjustment and (de-)activation suboptimal
  • faa6b66: 8295715: Minimize disabled warnings in serviceability libs
  • de1e0c5: 8295719: Remove unneeded disabled warnings in jdk.sctp
  • 9612cf9: 8295529: Add link to JBS to README.md
  • b37421e: 8295564: Norwegian Nynorsk Locale is missing formatting
  • ... and 7 more: https://git.openjdk.org/jdk/compare/9d0cfd1130b63f7acd67a52eb35c1ec38d43e514...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Oct 21, 2022
@openjdk openjdk bot closed this Oct 21, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 21, 2022
@openjdk
Copy link

openjdk bot commented Oct 21, 2022

@shipilev Pushed as commit dfd2d83.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@shipilev shipilev deleted the JDK-8295657-sa-obj-align branch October 21, 2022 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated serviceability serviceability-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

3 participants