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

8257436: [aarch64] Regressions in ArrayCopyUnalignedDst.testByte/testChar for 65-78 bytes when UseSIMDForMemoryOps is on #1558

Closed
wants to merge 1 commit into from

Conversation

eastig
Copy link
Contributor

@eastig eastig commented Dec 2, 2020

Copying data in range 65 - 80 bytes with

ldpq
ldpq 
ldp
stpq
stpq
stp

is faster than with

ldpq
ldpq
ldpq
stpq
stpq
stpq

when pointers involved are not properly aligned. This mostly affects byte and char arraycopy.
This patch fixes regressions of ArrayCopyUnalignedDst.testByte/testChar when UseSIMDForMemoryOps is on.
See the attached results for performance data
test_byte_results.txt
test_char_results.txt


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8257436: [aarch64] Regressions in ArrayCopyUnalignedDst.testByte/testChar for 65-78 bytes when UseSIMDForMemoryOps is on

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1558/head:pull/1558
$ git checkout pull/1558

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Dec 2, 2020

👋 Welcome back eastig! 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 added the rfr label Dec 2, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Dec 2, 2020

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

  • hotspot-compiler

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 hotspot-compiler label Dec 2, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Dec 2, 2020

Webrevs

@eastig
Copy link
Contributor Author

@eastig eastig commented Dec 2, 2020

@theRealAph could please check if it causes any issues on ThunderX 2?

Thanks,
Evgeny

@theRealAph
Copy link
Contributor

@theRealAph theRealAph commented Dec 2, 2020

@theRealAph could please check if it causes any issues on ThunderX 2?

Is there some script you use that generates the comparison? Otherwise it'll take some time.

@eastig
Copy link
Contributor Author

@eastig eastig commented Dec 2, 2020

@theRealAph could please check if it causes any issues on ThunderX 2?

Is there some script you use that generates the comparison? Otherwise it'll take some time.

Unfortunately, no. I have scripts that do runs. Then I pull all results in Excel.
BTW, I attached data comparing SIMD_OFF vs SIMD_ON(patch). JDK-8257436 has data showing regressions with SIMD three ldpq instructions. I'll attach data comparing SIMD_no_fix vs SIMD_fix later.

@eastig eastig force-pushed the JDK-8257436 branch 2 times, most recently from b7bd38d to 3d9d919 Compare Dec 2, 2020
@eastig
Copy link
Contributor Author

@eastig eastig commented Dec 2, 2020

I updated the attached data. It now includes the following:

  • UseSIMDForMemoryOps is off.
  • UseSIMDForMemoryOps is on.
  • UseSIMDForMemoryOps + fix is on.

The fix is narrowed to be used for byte and char arraycopies. They have the most problems with unaligned accesses. Int arraycopies are at least 4 byte aligned. Long arraycopies are always 8 byte aligned.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Dec 2, 2020

Mailing list message from Andrew Haley on hotspot-compiler-dev:

On 02/12/2020 11:14, Evgeny Astigeevich wrote:

On Wed, 2 Dec 2020 10:56:39 GMT, Andrew Haley <aph at openjdk.org> wrote:

@theRealAph could please check if it causes any issues on ThunderX 2?

Is there some script you use that generates the comparison? Otherwise it'll take some time.

Unfortunately, no. I have scripts that do runs. Then I pull all results in Excel.

Given the nature of the change, I don't expect to see regressions on
other hardware, so I don't think it's worth doing more testing.

--
Andrew Haley (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

@eastig
Copy link
Contributor Author

@eastig eastig commented Dec 2, 2020

I am attaching performance data for int arraycopy to show the impact of the patch on it:
test_int_results.txt

Copy link
Member

@simonis simonis left a comment

Hi Evegeny,

thanks for fixing this. Your change looks good to me. Thanks especially for measuring all the different cases.

I only have two minor request regarding the comments. Once fixed I'll sponsor this change.

Best regards,
Volker

src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp Outdated Show resolved Hide resolved
src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp Outdated Show resolved Hide resolved
…Char for 65-78 bytes when UseSIMDForMemoryOps is on

On Graviton 2 ArrayCopyUnaligned of data range 65 - 78 bytes with
the sequence of 'ldpq,ldpq,ldp,stpq,stpq,stp' is faster than with
the sequence of 'ldpq,ldpq,ldpq,stpq,stpq,stpq'.
simonis
simonis approved these changes Dec 3, 2020
Copy link
Member

@simonis simonis left a comment

Looks good now. Thanks!

@openjdk
Copy link

@openjdk openjdk bot commented Dec 3, 2020

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

8257436: [aarch64] Regressions in ArrayCopyUnalignedDst.testByte/testChar for 65-78 bytes when UseSIMDForMemoryOps is on

Reviewed-by: simonis

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

  • fa58671: 8257020: [JVMCI] enable a JVMCICompiler to specify which GCs it supports
  • 129c377: 8257594: C2 compiled checkcast of non-null object triggers endless deoptimization/recompilation cycle
  • e4497c9: 8256718: Obsolete the long term deprecated and aliased Trace flags
  • 4a267f1: 8244847: Linux/PPC: runtime/CompressedOops/CompressedClassPointers: smallHeapTest fails
  • b44a329: 8256864: [windows] Improve tracing for mapping errors
  • ae1eb28: 8257604: JNI_ArgumentPusherVaArg leaks valist
  • 4169d96: 8257143: Enable JVMCI code installation tests on AArch64
  • a5a034b: 8257617: TestLinkPlatform fails with new Java source version
  • d80ae05: 8166596: TLS support for the EdDSA signature algorithm
  • 3932527: 8257466: Improve enum iteration
  • ... and 41 more: https://git.openjdk.java.net/jdk/compare/60f2ba9a24416fc8d5f290c01cc8b2531f3b5ca8...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.

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 (@simonis) 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 ready label Dec 3, 2020
@eastig
Copy link
Contributor Author

@eastig eastig commented Dec 3, 2020

/integrate

@openjdk openjdk bot added the sponsor label Dec 3, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Dec 3, 2020

@eastig
Your change (at version c1f178e) is now ready to be sponsored by a Committer.

@simonis
Copy link
Member

@simonis simonis commented Dec 3, 2020

/sponsor

@openjdk openjdk bot closed this Dec 3, 2020
@openjdk openjdk bot added integrated and removed sponsor ready rfr labels Dec 3, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Dec 3, 2020

@simonis @eastig Since your change was applied there have been 53 commits pushed to the master branch:

  • b170c83: 8257591: Remove suppression of record preview related warnings in java.lang
  • 66a2e70: 8255845: Memory leak in imageFile.cpp
  • fa58671: 8257020: [JVMCI] enable a JVMCICompiler to specify which GCs it supports
  • 129c377: 8257594: C2 compiled checkcast of non-null object triggers endless deoptimization/recompilation cycle
  • e4497c9: 8256718: Obsolete the long term deprecated and aliased Trace flags
  • 4a267f1: 8244847: Linux/PPC: runtime/CompressedOops/CompressedClassPointers: smallHeapTest fails
  • b44a329: 8256864: [windows] Improve tracing for mapping errors
  • ae1eb28: 8257604: JNI_ArgumentPusherVaArg leaks valist
  • 4169d96: 8257143: Enable JVMCI code installation tests on AArch64
  • a5a034b: 8257617: TestLinkPlatform fails with new Java source version
  • ... and 43 more: https://git.openjdk.java.net/jdk/compare/60f2ba9a24416fc8d5f290c01cc8b2531f3b5ca8...master

Your commit was automatically rebased without conflicts.

Pushed as commit e836396.

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

@eastig eastig deleted the JDK-8257436 branch Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler integrated
3 participants