Skip to content

8369207: _Copy_conjoint_{jshorts,jints,jlongs}_atomic on Linux/BSD AArch64 do not prevent tearing - #27647

Closed
jcking wants to merge 1 commit into
openjdk:masterfrom
jcking:aarch64-linux-bsd-atomic-conjoint-copy
Closed

jcking wants to merge 1 commit into
openjdk:masterfrom
jcking:aarch64-linux-bsd-atomic-conjoint-copy

Conversation

@jcking

@jcking jcking commented Oct 6, 2025 •

Copy link
Copy Markdown
Contributor

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 <jcking@google.com>
@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

bridgekeeper Bot commented Oct 6, 2025

Copy link
Copy Markdown

👋 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

openjdk Bot commented Oct 6, 2025

Copy link
Copy Markdown

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

@openjdk openjdk Bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Oct 6, 2025
@openjdk

openjdk Bot commented Oct 6, 2025

Copy link
Copy Markdown

@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

mlbridge Bot commented Oct 6, 2025

Copy link
Copy Markdown

Webrevs

@theRealAph

Copy link
Copy Markdown
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

jcking commented Oct 6, 2025

Copy link
Copy Markdown
Contributor Author

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

jcking commented Oct 8, 2025

Copy link
Copy Markdown
Contributor Author

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
@bridgekeeper

bridgekeeper Bot commented Dec 4, 2025

Copy link
Copy Markdown

@jcking This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@bridgekeeper

bridgekeeper Bot commented Jan 29, 2026

Copy link
Copy Markdown

@jcking This pull request has been inactive for more than 16 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

@bridgekeeper bridgekeeper Bot closed this Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-runtime hotspot-runtime-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

2 participants