Skip to content

8367717: Cleanup atomic_copy64 - #27642

Closed
dev-jonghoonpark wants to merge 4 commits into
openjdk:masterfrom
dev-jonghoonpark:JDK-8367717-cleanup-atomic-copy64
Closed

dev-jonghoonpark wants to merge 4 commits into
openjdk:masterfrom
dev-jonghoonpark:JDK-8367717-cleanup-atomic-copy64

Conversation

@dev-jonghoonpark

@dev-jonghoonpark dev-jonghoonpark commented Oct 6, 2025 •

Copy link
Copy Markdown
Contributor

related jira issue: https://bugs.openjdk.org/browse/JDK-8367717

Changes

  • deleted all definitions of atomic_copy64
  • replaced all calls to atomic_copy64 with AtomicAccess::store(dst, AtomicAccess::load(src))

Verification

  • Verified by running:
    • make run-test TEST="gtest:StubRoutines*"
    • make run-test TEST="gtest:AtomicAccess*"

Please let me know if there are any additional or more appropriate verification steps I should perform.



Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8367717: Cleanup atomic_copy64 (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27642

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

Using diff file

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

Using Webrev

Link to Webrev Comment

Signed-off-by: jonghoonpark <dev@jonghoonpark.com>
@bridgekeeper

bridgekeeper Bot commented Oct 6, 2025

Copy link
Copy Markdown

👋 Welcome back dev-jonghoonpark! 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

@dev-jonghoonpark 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:

8367717: Cleanup atomic_copy64

Reviewed-by: kbarrett, dholmes

You can use pull request commands such as /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 4 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 (@kimbarrett, @dholmes-ora) 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 added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Oct 6, 2025
@openjdk

openjdk Bot commented Oct 6, 2025 •

Copy link
Copy Markdown

@dev-jonghoonpark 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

@kimbarrett kimbarrett left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As described in the issue, this change aligns atomic_copy64 definitions for
zero platforms with those of other platforms.

The issue suggests it might be better to replace calls to atomic_copy64 with
AtomicAccess::store(dst, AtomicAccess::load(src)) (using the new
AtomicAccess nomenclature), and then delete all definitions of
atomic_copy64. And there's a comment agreeing with that suggestion. I think
that's the way to go, rather than what this PR proposes.

@dev-jonghoonpark

Copy link
Copy Markdown
Contributor Author

@kimbarrett

Thanks for the feedback.
I thought the plan was to align the definitions first, and then implement the new form later.
I'll revise the work to make the change to the new formulation, as you suggested.

@dev-jonghoonpark
dev-jonghoonpark marked this pull request as draft October 6, 2025 07:48
@openjdk openjdk Bot removed the rfr Pull request is ready for review label Oct 6, 2025
Signed-off-by: jonghoonpark <dev@jonghoonpark.com>
@dev-jonghoonpark
dev-jonghoonpark marked this pull request as ready for review October 6, 2025 09:34
@openjdk openjdk Bot added the rfr Pull request is ready for review label Oct 6, 2025
@jcking

jcking commented Oct 6, 2025

Copy link
Copy Markdown
Contributor

This partially fixes https://bugs.openjdk.org/browse/JDK-8369207 as well, but this only does it for jlong. I can wait for this to go in, and then update jshort and jint to use AtomicAccess as well or we can do it all in this PR.

@kimbarrett

kimbarrett commented Oct 7, 2025 •

Copy link
Copy Markdown

This partially fixes https://bugs.openjdk.org/browse/JDK-8369207 as well, but this only does it for jlong. I can wait for this to go in, and then update jshort and jint to use AtomicAccess as well or we can do it all in this PR.

@jcking - I noticed that problem too, while reviewing this change. I don't care
whether it is fixed in this PR or in yours.

Note that your's currently doesn't perform atomic accesses on the "from"
value. I think that's wrong, since the documentation for these functions
doesn't indicate atomicity only for the store. The comment in copy.hpp says
"atomicity: atomic or non-atomic on the copy unit." I take that to mean both
source and destination.

Your PR is also not addressing other platforms with similar issues, such as in
copy_ppc.hpp.

Also, this all begs the question of why we have four different copies of these
functions - bsd_aarch64, bsd_zero, linux_aarch64, and linux_zero. All of these
should be identical.

Basically, I think the Copy class is kind of a mess, and that discourages its
use. Probably this needs an overall plan of attack (broken up into reviewable
chunks, but with an overarching goal), rather than piecemeal fixups.

@jcking

jcking commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

@kimbarrett

Proposal, should we do something similar to AtomicAccess? Provide default naive implementations and let each platform specialize?

@kimbarrett

kimbarrett commented Oct 9, 2025 •

Copy link
Copy Markdown

@jcking I think AtomicAccess mostly already has platform-specific specializations. A case where it doesn't
is the bitops, but there we have a default naive implementation, with the intent that platforms will (eventually)
specialize. There's one of those efforts being reviewed now (for ppc).

@bridgekeeper

bridgekeeper Bot commented Nov 6, 2025

Copy link
Copy Markdown

@dev-jonghoonpark This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 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!

@dev-jonghoonpark

Copy link
Copy Markdown
Contributor Author

The discussion seems unresolved, so I’ll convert this PR back to draft for now.

@dev-jonghoonpark
dev-jonghoonpark marked this pull request as draft December 4, 2025 01:15
@openjdk openjdk Bot removed the rfr Pull request is ready for review label Dec 4, 2025
@bridgekeeper

bridgekeeper Bot commented Jan 29, 2026

Copy link
Copy Markdown

@dev-jonghoonpark 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 Mar 26, 2026

Copy link
Copy Markdown

@dev-jonghoonpark 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 Mar 26, 2026
@dholmes-ora

Copy link
Copy Markdown
Member

@dev-jonghoonpark Can we re-open this as-is and keep the scope simply to replacing atomic_copy64 with the AtomicAccess load and store operations.

@dev-jonghoonpark

Copy link
Copy Markdown
Contributor Author

Sorry for the late reply, I missed your comment.
I’ll update the branch with the latest master and follow up.

/open

@openjdk openjdk Bot reopened this Oct 24, 2026
@openjdk

openjdk Bot commented Oct 24, 2026

Copy link
Copy Markdown

@dev-jonghoonpark This pull request is now open

@openjdk

openjdk Bot commented Oct 24, 2026

Copy link
Copy Markdown

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot-runtime. This can be overridden with the /reviewers command.

@dev-jonghoonpark
dev-jonghoonpark marked this pull request as ready for review October 24, 2026 00:48
@openjdk openjdk Bot added the rfr Pull request is ready for review label Oct 24, 2026

@kimbarrett kimbarrett left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I agree with @dholmes-ora, this change looks fine in its current form
(except the copyrights need to be updated now). There are followups
that can be done for further improvement, but this is a good
incremental change.

Signed-off-by: jonghoonpark <dev@jonghoonpark.com>
@dev-jonghoonpark

Copy link
Copy Markdown
Contributor Author

@kimbarrett Thanks for checking. I’ve updated the copyright. Could you please re-review and approve?

@kimbarrett kimbarrett left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

still good.

@dholmes-ora dholmes-ora left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM2. Thanks

(Nice to hear from you @kimbarrett !)

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Oct 26, 2026
@dev-jonghoonpark

Copy link
Copy Markdown
Contributor Author

/integrate

@openjdk openjdk Bot added the sponsor Pull request is ready to be sponsored label Oct 26, 2026
@openjdk

openjdk Bot commented Oct 26, 2026

Copy link
Copy Markdown

@dev-jonghoonpark
Your change (at version a31c2da) is now ready to be sponsored by a Committer.

@dholmes-ora

Copy link
Copy Markdown
Member

/sponsor

@openjdk

openjdk Bot commented Oct 26, 2026

Copy link
Copy Markdown

Going to push as commit ec081d9.
Since your change was applied there have been 4 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 Oct 26, 2026
@openjdk openjdk Bot closed this Oct 26, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Oct 26, 2026
@openjdk

openjdk Bot commented Oct 26, 2026

Copy link
Copy Markdown

@dholmes-ora @dev-jonghoonpark Pushed as commit ec081d9.

💡 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

hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants