Skip to content
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

8345322: RISC-V: Add concurrent gtests for cmpxchg variants #22574

Closed
wants to merge 10 commits into from

Conversation

robehn
Copy link
Contributor

@robehn robehn commented Dec 5, 2024

Hi, please consider these additional concurrent tests.

(this will not go into 24)

There are two concurrent counter versions:

  • Each thread is exclusively responsible for an certain increment steps
  • Each thread plainly tries to CAS increment by one

I refactored the code, so these concurrent versions can reuse the generated CAS functions.

[ RUN      ] RiscV.cmpxchg_int64_concurrent_lr_sc_vm
[       OK ] RiscV.cmpxchg_int64_concurrent_lr_sc_vm (24 ms)
[ RUN      ] RiscV.cmpxchg_int64_concurrent_maybe_zacas_vm
[       OK ] RiscV.cmpxchg_int64_concurrent_maybe_zacas_vm (12 ms)
[ RUN      ] RiscV.cmpxchg_int32_concurrent_lr_sc_vm
[       OK ] RiscV.cmpxchg_int32_concurrent_lr_sc_vm (14 ms)
[ RUN      ] RiscV.cmpxchg_int32_concurrent_maybe_zacas_vm
[       OK ] RiscV.cmpxchg_int32_concurrent_maybe_zacas_vm (14 ms)
[ RUN      ] RiscV.cmpxchg_int16_concurrent_lr_sc_vm
[       OK ] RiscV.cmpxchg_int16_concurrent_lr_sc_vm (15 ms)
[ RUN      ] RiscV.cmpxchg_int16_concurrent_maybe_zacas_vm
[       OK ] RiscV.cmpxchg_int16_concurrent_maybe_zacas_vm (14 ms)
[ RUN      ] RiscV.cmpxchg_int8_concurrent_lr_sc_vm
[       OK ] RiscV.cmpxchg_int8_concurrent_lr_sc_vm (14 ms)
[ RUN      ] RiscV.cmpxchg_int8_concurrent_maybe_zacas_vm
[       OK ] RiscV.cmpxchg_int8_concurrent_maybe_zacas_vm (14 ms)
[ RUN      ] RiscV.weak_cmpxchg_int64_concurrent_lr_sc_vm
[       OK ] RiscV.weak_cmpxchg_int64_concurrent_lr_sc_vm (15 ms)
[ RUN      ] RiscV.weak_cmpxchg_int64_concurrent_maybe_zacas_vm
[       OK ] RiscV.weak_cmpxchg_int64_concurrent_maybe_zacas_vm (11 ms)
[ RUN      ] RiscV.weak_cmpxchg_int32_concurrent_lr_sc_vm
[       OK ] RiscV.weak_cmpxchg_int32_concurrent_lr_sc_vm (15 ms)
[ RUN      ] RiscV.weak_cmpxchg_int32_concurrent_maybe_zacas_vm
[       OK ] RiscV.weak_cmpxchg_int32_concurrent_maybe_zacas_vm (12 ms)
[ RUN      ] RiscV.weak_cmpxchg_int16_concurrent_lr_sc_vm
[       OK ] RiscV.weak_cmpxchg_int16_concurrent_lr_sc_vm (13 ms)
[ RUN      ] RiscV.weak_cmpxchg_int16_concurrent_maybe_zacas_vm
[       OK ] RiscV.weak_cmpxchg_int16_concurrent_maybe_zacas_vm (14 ms)
[ RUN      ] RiscV.weak_cmpxchg_int8_concurrent_lr_sc_vm
[       OK ] RiscV.weak_cmpxchg_int8_concurrent_lr_sc_vm (13 ms)
[ RUN      ] RiscV.weak_cmpxchg_int8_concurrent_maybe_zacas_vm
[       OK ] RiscV.weak_cmpxchg_int8_concurrent_maybe_zacas_vm (15 ms)

Execute with +UseZacas, and without on BPI-F3.

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-8345322: RISC-V: Add concurrent gtests for cmpxchg variants (Sub-task - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22574

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 5, 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 Dec 5, 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:

8345322: RISC-V: Add concurrent gtests for cmpxchg variants

Reviewed-by: mli, 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 18 new commits pushed to the master branch:

  • 4fc43b0: 8345770: javadoc: API documentation builds are not always reproducible
  • ee1c5ad: 8345975: Update SAP SE copyright year to 2024 where it was missed
  • 3518b4b: 8344171: Clone and initialize Assertion Predicates in order instead of in reverse-order
  • c88e081: 8346160: Fix -Wzero-as-null-pointer-constant warnings from explicit casts
  • ab1dbd4: 8346202: Correct typo in SQLPermission
  • 6b022bb: 8344453: Test jdk/jfr/event/oldobject/TestSanityDefault.java timed out
  • 3b9de11: 8319875: Add macOS implementation for jcmd System.map
  • ebb27c2: 8346139: test_memset_with_concurrent_readers.cpp should not use
  • c2f0ef5: 8346159: Disable CDS AOTClassLinking tests for JVMCI due to JDK-8345635
  • 4b21fb9: 8343467: Remove unnecessary @SuppressWarnings annotations (security)
  • ... and 8 more: https://git.openjdk.org/jdk/compare/31ceec7cd55b455cddf0953cc23aaa64612bd6e7...master

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 Dec 5, 2024
@openjdk
Copy link

openjdk bot commented Dec 5, 2024

@robehn To determine the appropriate audience for reviewing this pull request, one or more labels corresponding to different subsystems will normally be applied automatically. However, no automatic labelling rule matches the changes in this pull request. In order to have an "RFR" email sent to the correct mailing list, you will need to add one or more applicable labels manually using the /label pull request command.

Applicable Labels
  • build
  • client
  • compiler
  • core-libs
  • graal
  • hotspot
  • hotspot-compiler
  • hotspot-gc
  • hotspot-jfr
  • hotspot-runtime
  • i18n
  • ide-support
  • javadoc
  • jdk
  • jmx
  • kulla
  • net
  • nio
  • security
  • serviceability
  • shenandoah

@robehn
Copy link
Contributor Author

robehn commented Dec 5, 2024

/label add hotspot

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Dec 5, 2024
@openjdk
Copy link

openjdk bot commented Dec 5, 2024

@robehn
The hotspot label was successfully added.

@mlbridge
Copy link

mlbridge bot commented Dec 5, 2024

Webrevs

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 tests, Thanks!
The code looks good, just some minor comments about the name.

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.

Thanks for the update. Two comments remain.

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.

Latest version looks good to me. Nice work!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 12, 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 work. Thanks!

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Dec 12, 2024
@robehn
Copy link
Contributor Author

robehn commented Dec 12, 2024

Thanks @Hamlin-Li @RealFYang

But I wanted to add the edge cases, so I found an issue in the gtest.

Fixed! Please have another look!

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.

Still good. It is passing on my P550 SBC.

@robehn
Copy link
Contributor Author

robehn commented Dec 13, 2024

Still good. It is passing on my P550 SBC.

Great thanks!

@Hamlin-Li still happy about this?

@robehn
Copy link
Contributor Author

robehn commented Dec 16, 2024

Ping @Hamlin-Li

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.

Sorry for the late reply.
Yes, still good. Thanks!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 16, 2024
@robehn
Copy link
Contributor Author

robehn commented Dec 16, 2024

Thanks @Hamlin-Li !

@robehn
Copy link
Contributor Author

robehn commented Dec 16, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Dec 16, 2024

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

  • 4fc43b0: 8345770: javadoc: API documentation builds are not always reproducible
  • ee1c5ad: 8345975: Update SAP SE copyright year to 2024 where it was missed
  • 3518b4b: 8344171: Clone and initialize Assertion Predicates in order instead of in reverse-order
  • c88e081: 8346160: Fix -Wzero-as-null-pointer-constant warnings from explicit casts
  • ab1dbd4: 8346202: Correct typo in SQLPermission
  • 6b022bb: 8344453: Test jdk/jfr/event/oldobject/TestSanityDefault.java timed out
  • 3b9de11: 8319875: Add macOS implementation for jcmd System.map
  • ebb27c2: 8346139: test_memset_with_concurrent_readers.cpp should not use
  • c2f0ef5: 8346159: Disable CDS AOTClassLinking tests for JVMCI due to JDK-8345635
  • 4b21fb9: 8343467: Remove unnecessary @SuppressWarnings annotations (security)
  • ... and 8 more: https://git.openjdk.org/jdk/compare/31ceec7cd55b455cddf0953cc23aaa64612bd6e7...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Dec 16, 2024

@robehn Pushed as commit 9286018.

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

@robehn robehn deleted the 8345322 branch December 16, 2024 09:53
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