Skip to content

Conversation

jcking
Copy link
Contributor

@jcking jcking commented Oct 6, 2025

Ensure the compiler cannot optimize the copy loops by replacing them with memcpy which is allowed to copy byte by byte potentially introducing tearing. Currently there is nothing preventing the compiler from doing this. We add volatile which prevents the compiler from making this optimization in the future.

Currently the code generates to ldp and stp, this change does have the side affect of forcing it to do ldr and str. If that seems unacceptable from a performance standpoint we can hand-roll assembly to do ldp and stp.


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-8369207: Copy_conjoint{jshorts,jints,jlongs}_atomic on Linux/BSD AArch64 do not prevent tearing (Bug - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27647

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

Using diff file

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

Using Webrev

Link to Webrev Comment

…D AArch64 do not prevent tearing

Signed-off-by: Justin King <[email protected]>
@jcking jcking changed the title JDK-8369207: _Copy_conjoint_{jshorts,jints,jlongs}_atomic on Linux/BSD AArch64 do not prevent tearing 8369207: _Copy_conjoint_{jshorts,jints,jlongs}_atomic on Linux/BSD AArch64 do not prevent tearing Oct 6, 2025
@bridgekeeper
Copy link

bridgekeeper bot commented Oct 6, 2025

👋 Welcome back jcking! 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 Oct 6, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Oct 6, 2025

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

  • hotspot-runtime

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 rfr Pull request is ready for review label Oct 6, 2025
@mlbridge
Copy link

mlbridge bot commented Oct 6, 2025

Webrevs

@theRealAph
Copy link
Contributor

Currently the code generates to ldp and stp, this change does have the side affect of forcing it to do ldr and str. If that seems unacceptable from a performance standpoint we can hand-roll assembly to do ldp and stp.

That would be much better.

@jcking
Copy link
Contributor Author

jcking commented Oct 6, 2025

Currently the code generates to ldp and stp, this change does have the side affect of forcing it to do ldr and str. If that seems unacceptable from a performance standpoint we can hand-roll assembly to do ldp and stp.

That would be much better.

#27642 is already going to move it to ldr and str, FYI.

@jcking
Copy link
Contributor Author

jcking commented Oct 8, 2025

Moving this back to draft until discussions in #27642 finish.

@jcking jcking marked this pull request as draft October 8, 2025 12:30
@openjdk openjdk bot removed the rfr Pull request is ready for review label Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants