Skip to content

8344010: RISC-V: Zacas do not work with LW locking #22149

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 1 commit into from

Conversation

robehn
Copy link
Contributor

@robehn robehn commented Nov 15, 2024

Hi all, please consider.

Light weight locking fails:

  • We need to add cas acquire.
  • Register result may shadow new_val (same register).
    (NOTE this second item can effect many other cases, unclear)

As the code becomes much cleaner by calling amocas_d/w directly I removed the aliases.
Which fixes the first issue with cas acquire.

By using t0 instead of result we fix the other issue.

This is a short bugfix, there are so many dragons here that I do not want to address them while fixing the bug.
There are also several performance optimizations we can do here, specially for LR/SC case.
So I'll do a couple of more iterations of this code in seperate PR's.

Testing a bunch of local cherry-picked tests which failed.
I'll start tier1 over the weekend.

Thanks, Robbin


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-8344010: RISC-V: Zacas do not work with LW locking (Bug - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22149

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 15, 2024

👋 Welcome back rehn! 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
Copy link

openjdk bot commented Nov 15, 2024

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

8344010: RISC-V: Zacas do not work with LW locking

Reviewed-by: fyang, mli

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 107 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 rfr Pull request is ready for review label Nov 15, 2024
@openjdk
Copy link

openjdk bot commented Nov 15, 2024

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

  • hotspot

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 hotspot hotspot-dev@openjdk.org label Nov 15, 2024
@mlbridge
Copy link

mlbridge bot commented Nov 15, 2024

Webrevs

Copy link
Member

@RealFYang RealFYang left a comment

Choose a reason for hiding this comment

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

Good catch. Thanks for carrying out the test. Looks good modulo one minor question.

@robehn
Copy link
Contributor Author

robehn commented Nov 18, 2024

Good catch. Thanks for carrying out the test. Looks good modulo one minor question.

Thanks! I found some failures in testing, investigating.

Update:
The failure is there regradless of this patch:
CASandCAEwithNegExpected.java using -XX:+UnlockExperimentalVMOptions -XX:+UseZacas -XX:LockingMode=0

Which means zacas is still broken after this patch, but at least LW locking is working.
(failure seems to be related to weak cmpxchg)
I'll continue that work in: https://bugs.openjdk.org/browse/JDK-8344382

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 18, 2024
Copy link

@Hamlin-Li Hamlin-Li left a comment

Choose a reason for hiding this comment

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

Nice catch and cleanup, looks much better!
Just one minor comment.

@bridgekeeper bridgekeeper bot added oca Needs verification of OCA signatory status and removed oca Needs verification of OCA signatory status labels Nov 19, 2024
@robehn
Copy link
Contributor Author

robehn commented Nov 20, 2024

Nice catch and cleanup, looks much better! Just one minor comment.

Thanks!

Copy link

@Hamlin-Li Hamlin-Li left a comment

Choose a reason for hiding this comment

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

Thanks, current fix looks good!

@robehn
Copy link
Contributor Author

robehn commented Nov 20, 2024

Thanks, current fix looks good!

Thanks!

@robehn
Copy link
Contributor Author

robehn commented Nov 20, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Nov 20, 2024

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

  • e2f8f1a: 8344621: ProblemList runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java
  • afee740: 8343541: C1: Plain memory accesses are emitted with membars with +AlwaysAtomicAccesses
  • 3a4a9b7: 8340145: Problem with generic pattern matching results in internal compiler error
  • cf158bc: 8341631: JShell should auto-import java.io.IO.*
  • 5b12a87: 8344060: Remove doPrivileged calls from shared implementation code in the java.desktop module : part 1
  • 587f2b4: 8343827: RISC-V: set AlignVector as false if applicable to enable SLP
  • 189fc8d: 8344381: [s390x] Test failures with error: Register type is not known
  • 8a1f9f0: 8343476: Remove unnecessary @SuppressWarnings annotations (client)
  • 4ddd3de: 8344356: Aarch64: implement -XX:+VerifyActivationFrameSize
  • bc7eabd: 8344350: Add '.gdbinit' and '.lldbinit' to file '.gitignore'
  • ... and 100 more: https://git.openjdk.org/jdk/compare/5e2760856c3844d9ad6200fef0c09ece0acac73a...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Nov 20, 2024

@robehn Pushed as commit ea7e722.

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

@robehn robehn deleted the zacas-lw-fix branch November 27, 2024 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants