Skip to content

Conversation

@feilongjiang
Copy link
Member

@feilongjiang feilongjiang commented Jun 25, 2025

Fixes RISC-V memory ordering problem.
This patch is not clean because JDK-8293290 adds a third temporary register to store_heap_oop, which is introduced in JDK20.
In JDK17, do_oop_store also clobbers the same x13 as in mailine. The current fix is similar to aarch64 in mainline, but puts the flags in x15 instead, to avoid the clobber of the volatile bits.

Additional testing:

  • linux-riscv64 server release, jcstress RefDekker test now passes
  • linux-riscv64 server release, Tier1-3

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
  • JDK-8357968 needs maintainer approval

Issue

  • JDK-8357968: RISC-V: Interpreter volatile reference stores with G1 are not sequentially consistent (Bug - P4 - Approved)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/3678/head:pull/3678
$ git checkout pull/3678

Update a local copy of the PR:
$ git checkout pull/3678
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/3678/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3678

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/3678.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 25, 2025

👋 Welcome back fjiang! 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 Jun 25, 2025

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

8357968: RISC-V: Interpreter volatile reference stores with G1 are not sequentially consistent

Reviewed-by: rehn, fyang

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 6 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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@robehn, @RealFYang) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot changed the title Backport c5a1543ee3e68775f09ca29fb07efd9aebfdb33e 8357968: RISC-V: Interpreter volatile reference stores with G1 are not sequentially consistent Jun 25, 2025
@openjdk
Copy link

openjdk bot commented Jun 25, 2025

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport Port of a pull request already in a different code base rfr Pull request is ready for review labels Jun 25, 2025
@mlbridge
Copy link

mlbridge bot commented Jun 25, 2025

Webrevs

@feilongjiang feilongjiang marked this pull request as draft June 25, 2025 15:21
@openjdk openjdk bot removed the rfr Pull request is ready for review label Jun 25, 2025
@feilongjiang feilongjiang marked this pull request as ready for review June 26, 2025 01:33
@feilongjiang
Copy link
Member Author

@robehn, would you please take a look?

@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 26, 2025
Copy link
Contributor

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

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.

Looks good.

@openjdk
Copy link

openjdk bot commented Jun 26, 2025

⚠️ @feilongjiang This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@feilongjiang
Copy link
Member Author

/approval request Fixes the corner case in RISC-V interpreter, manifests as memory model problem.
Same issue exists in jdk17u repo as well. And the bug is reproducible with jcstress RefDekker test with jdk17u.
Backport is not clean. This is a RISC-V specific change, 17u version differs a bit from mainline version, see 17u PR.
Tier1-3 tested on linux-riscv64 platform. jcstress RefDekker test passes with this backport.

@openjdk
Copy link

openjdk bot commented Jun 26, 2025

@feilongjiang
8357968: The approval request has been created successfully.

@openjdk openjdk bot added approval Requires approval; will be removed when approval is received ready Pull request is ready to be integrated and removed approval Requires approval; will be removed when approval is received labels Jun 26, 2025
@feilongjiang
Copy link
Member Author

@robehn @RealFYang -- Thanks!
/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jun 27, 2025
@openjdk
Copy link

openjdk bot commented Jun 27, 2025

@feilongjiang
Your change (at version 3cdd9a4) is now ready to be sponsored by a Committer.

@RealFYang
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Jun 27, 2025

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

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 27, 2025
@openjdk openjdk bot closed this Jun 27, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 27, 2025
@openjdk openjdk bot removed the sponsor Pull request is ready to be sponsored label Jun 27, 2025
@openjdk
Copy link

openjdk bot commented Jun 27, 2025

@RealFYang @feilongjiang Pushed as commit 76e1329.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Port of a pull request already in a different code base integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants