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

8309502: RISC-V: String.indexOf intrinsic may produce misaligned memory loads #1857

Closed
wants to merge 1 commit into from

Conversation

omikhaltsova
Copy link

@omikhaltsova omikhaltsova commented Oct 8, 2023

I'd like to backport JDK-8309502 to jdk17u. This fix is related only to RISC-V.

The patch applies almost cleanly except src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp because of deletion an empty line at the end in the original patch.

Testing: tier1 tests successfully passed on a RISC-V HiFive board with Linux.

As it's described in the original fix, this performance improvement can be observed by running the StringIndexOf.advancedWithMediumSub benchmark. The results for jdk17u are as follow:
Before

Benchmark                            Mode  Cnt       Score      Error  Units
StringIndexOf.advancedWithMediumSub  avgt   25  618932.002 ± 7990.408  ns/op

After

Benchmark                            Mode  Cnt      Score     Error  Units
StringIndexOf.advancedWithMediumSub  avgt   25  36884.314 ± 196.536  ns/op

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-8309502 needs maintainer approval

Issue

  • JDK-8309502: RISC-V: String.indexOf intrinsic may produce misaligned memory loads (Enhancement - P3 - Approved)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1857

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 8, 2023

👋 Welcome back omikhaltcova! 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 changed the title Backport 6b942893868fa1a64977288bdbdb1bbff8bd9d9c 8309502: RISC-V: String.indexOf intrinsic may produce misaligned memory loads Oct 8, 2023
@openjdk
Copy link

openjdk bot commented Oct 8, 2023

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

@openjdk openjdk bot added the backport label Oct 8, 2023
@omikhaltsova omikhaltsova marked this pull request as ready for review October 9, 2023 09:20
@openjdk openjdk bot added rfr Pull request is ready for review approval labels Oct 9, 2023
Copy link

@VladimirKempik VladimirKempik left a comment

Choose a reason for hiding this comment

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

lgtm

@openjdk
Copy link

openjdk bot commented Oct 9, 2023

⚠️ @omikhaltsova 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.

@mlbridge
Copy link

mlbridge bot commented Oct 9, 2023

Webrevs

@GoeLin
Copy link
Member

GoeLin commented Oct 10, 2023

/approve yes

@openjdk
Copy link

openjdk bot commented Oct 10, 2023

@GoeLin
8309502: The approval request has been approved.

@openjdk
Copy link

openjdk bot commented Oct 10, 2023

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

8309502: RISC-V: String.indexOf intrinsic may produce misaligned memory loads

Reviewed-by: vkempik

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 9 new commits pushed to the master branch:

  • 66baa03: 8272998: ImageIO.read() throws incorrect exception type
  • a393f25: 8303607: SunMSCAPI provider leaks memory and keys
  • d7e22e8: 8315683: Parallelize java/util/concurrent/tck/JSR166TestCase.java
  • 056ba2d: 8316566: RISC-V: Zero extended narrow oop passed to Atomic::cmpxchg
  • 3f29f1e: 8311585: Add JRadioButtonMenuItem to bug8031573.java
  • 6a0dfaf: 8308223: failure handler missed jcmd.vm.info command
  • aaa6962: 8290909: MemoryPoolMBean/isUsageThresholdExceeded tests failed with "isUsageThresholdExceeded() returned false, and is still false, while threshold = MMMMMMM and used peak = NNNNNNN"
  • c00d445: 8317121: vector_masked_load instruction is moved too early after JDK-8286941
  • 18fd988: 8298868: Update EngineCloseOnAlert.java for changes to TLS implementation

Please see this link for an up-to-date comparison between the source branch of this pull request and 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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed approval labels Oct 10, 2023
@omikhaltsova
Copy link
Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 10, 2023

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

  • 943ee59: 8287671: Adjust ForceGC to invoke System::gc fewer times for negative case
  • e71a980: 8266593: vmTestbase/nsk/jvmti/PopFrame/popframe011 fails with "assert(java_thread == _state->get_thread()) failed: Must be"
  • 66baa03: 8272998: ImageIO.read() throws incorrect exception type
  • a393f25: 8303607: SunMSCAPI provider leaks memory and keys
  • d7e22e8: 8315683: Parallelize java/util/concurrent/tck/JSR166TestCase.java
  • 056ba2d: 8316566: RISC-V: Zero extended narrow oop passed to Atomic::cmpxchg
  • 3f29f1e: 8311585: Add JRadioButtonMenuItem to bug8031573.java
  • 6a0dfaf: 8308223: failure handler missed jcmd.vm.info command
  • aaa6962: 8290909: MemoryPoolMBean/isUsageThresholdExceeded tests failed with "isUsageThresholdExceeded() returned false, and is still false, while threshold = MMMMMMM and used peak = NNNNNNN"
  • c00d445: 8317121: vector_masked_load instruction is moved too early after JDK-8286941
  • ... and 1 more: https://git.openjdk.org/jdk17u-dev/compare/adef8e467c0e2f36146627ace77f79d874c26783...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 10, 2023

@omikhaltsova Pushed as commit 8e4f66a.

💡 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 integrated Pull request has been integrated
3 participants