Skip to content

8318776: Require supports_cx8 to always be true #16625

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

Closed
wants to merge 9 commits into from

Conversation

dholmes-ora
Copy link
Member

@dholmes-ora dholmes-ora commented Nov 13, 2023

As discussed in JBS all platforms (some tweaks to Zero are in progress) actually do support cx8 i.e. 64-bit compare-and-exchange, so we can strip out the locked-based alternatives to using it and just add a guarantee that it is true at runtime. And all platforms except some ARM variants set SUPPORTS_NATIVE_CX8, so we can greatly simplify things. Summary of changes:

  • _supports_cx8 field is only needed when SUPPORTS_NATIVE_CX8 is not defined
  • Assertions for supports_cx8() are removed
  • Compiler predicates requiring supports_cx8() are removed
  • Access backend is greatly simplified without the need for lock-based alternative
  • java.util.concurrent.AtomicLongFieldUpdater is simplified without the need for a lock-based alternative

I did consider moving all the ARM kuser_helper related code to be only defined when SUPPORTS_NATIVE_CX8 is not defined, but there was a theoretical risk this could change the behaviour if ARMv7 binaries were run on other ARM CPU's. I added a note to that effect in vm_version_linux_arm32.cpp so the ARM port maintainers could clean this up further if desired.

Testing:

  • All Oracle tiers 1-5 builds (which includes an ARMv7 build)
  • GHA builds/tests
  • Oracle tiers 1-3 sanity testing

Zero changes coming in via JDK-8319777 will be merged when they arrive.

Thanks.


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

  • JDK-8318776: Require supports_cx8 to always be true (Enhancement - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16625

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 13, 2023

👋 Welcome back dholmes! 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 Nov 13, 2023
@openjdk
Copy link

openjdk bot commented Nov 13, 2023

@dholmes-ora The following labels will be automatically applied to this pull request:

  • build
  • core-libs
  • hotspot
  • shenandoah

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added hotspot hotspot-dev@openjdk.org build build-dev@openjdk.org core-libs core-libs-dev@openjdk.org shenandoah shenandoah-dev@openjdk.org labels Nov 13, 2023
@mlbridge
Copy link

mlbridge bot commented Nov 13, 2023

Webrevs

@magicus
Copy link
Member

magicus commented Nov 14, 2023

/label -build

@openjdk openjdk bot removed the build build-dev@openjdk.org label Nov 14, 2023
@openjdk
Copy link

openjdk bot commented Nov 14, 2023

@magicus
The build label was successfully removed.

Copy link
Contributor

@fisk fisk left a comment

Choose a reason for hiding this comment

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

This looks great!

@openjdk
Copy link

openjdk bot commented Nov 21, 2023

@dholmes-ora 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:

8318776: Require supports_cx8 to always be true

Reviewed-by: eosterlund, shade, dcubed

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 Nov 21, 2023
@dholmes-ora
Copy link
Member Author

Thanks for the review @fisk ! I have to wait for a few Zero related PRs to get integrated then re-merge, before I can integrate.

@shipilev
Copy link
Member

Thanks for the review @fisk ! I have to wait for a few Zero related PRs to get integrated then re-merge, before I can integrate.

Zero patches were pushed, please re-merge. I checked current mainline works well with at least linux-arm-zero-fastdebug, and I would like to re-test it with this patch.

@dholmes-ora
Copy link
Member Author

@shipilev I have re-merged and update the Zero changes (ifdef around _saupports_cx8).

@viktorklang-ora and/or @DougLea could I ask you to look at the java.util.concurrent.AtomicLongFieldUpdater changes please.

Copy link
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

Thanks! Zero tests are running. The PR looks great, except extra safety suggestion in x86 part:

@shipilev
Copy link
Member

Zero tests are running.

Caught the guarantee on linux-arm-zero-fastdebug! But that is actually the fault in my previous patch: #16779.

@DougLea
Copy link
Contributor

DougLea commented Nov 22, 2023

The deletion of backup code and the check for it in java.util.concurrent.AtomicLongFieldUpdater are clearly OK. We always thought the need for it was transient.

Copy link
Member

@dcubed-ojdk dcubed-ojdk left a comment

Choose a reason for hiding this comment

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

Wow! This PR is much larger than I expected.

Thumbs up!

@dholmes-ora
Copy link
Member Author

Thanks for looking at this @DougLea !

@dholmes-ora
Copy link
Member Author

Wow! This PR is much larger than I expected.

Thumbs up!

Thanks for the Review Dan! Yes lots of code deletion engineering in this one - and even better I got to delete template code with meta-programming stuff! :D

@viktorklang-ora
Copy link
Contributor

@dholmes-ora Just passing by -- impressed by the thorough update!

@dholmes-ora
Copy link
Member Author

Thanks for taking a look @viktorklang-ora !

Copy link
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

Ran full jcstress on linux-arm-zero-release on RPi 4 without problem.

@openjdk
Copy link

openjdk bot commented Nov 23, 2023

@dholmes-ora this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout 8318776-supports_cx8
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added merge-conflict Pull request has merge conflict with target branch and removed ready Pull request is ready to be integrated labels Nov 23, 2023
@openjdk openjdk bot added ready Pull request is ready to be integrated and removed merge-conflict Pull request has merge conflict with target branch labels Nov 23, 2023
@dholmes-ora
Copy link
Member Author

Thanks for all the reviews. Integrating now.

/integrate

@openjdk
Copy link

openjdk bot commented Nov 23, 2023

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

  • 14557e7: 8314502: Change the comparator taking version of GrowableArray::find to be a template method
  • 2802643: 8314243: Make VM_Exit::wait_for_threads_in_native_to_block wait for user threads time configurable
  • 6f26311: 8318490: Increase timeout for JDK tests that are close to the limit when run with libgraal
  • cb95e39: 8224261: JProgressBar always with border painted around it
  • 6d79e0a: 8318159: RISC-V: Improve itable_stub
  • 06f040b: 8320645: DocLint should use javax.lang.model to detect default constructors
  • beaa79c: 8320663: Fix C syntax in LIB_SETUP_HSDIS_BINUTILS
  • 3787ff8: 8319700: [AArch64] C2 compilation fails with "Field too big for insn"

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Nov 23, 2023

@dholmes-ora Pushed as commit c75c388.

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

@dholmes-ora dholmes-ora deleted the 8318776-supports_cx8 branch November 23, 2023 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated shenandoah shenandoah-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

7 participants