jdk17u-dev icon indicating copy to clipboard operation
jdk17u-dev copied to clipboard

8350483: AArch64: turn on signum intrinsics by default on Ampere CPUs

Open cnqpzhang opened this issue 8 months ago • 13 comments
trafficstars

Backport the commit to set -XX:+UseSignumIntrinsic by default for Ampere CPUs. It is to fix performance problem observed on JMH cases vm.compiler.Signum|java.lang.*MathBench.sig[nN]um*. For example, vm.compiler.Signum._1_signumFloatTest thrpt score becomes 30x better on both jdk mainline and jdk17u-dev. The backporting can be very safe as it is limited to Ampere CPUs only and well verified on Ampere-1A with related jmh and jtreg tier1 tests.


Progress

  • [x] Change must not contain extraneous whitespace
  • [ ] JDK-8350483 needs maintainer approval
  • [x] Commit message must refer to an issue

Issue

  • JDK-8350483: AArch64: turn on signum intrinsics by default on Ampere CPUs (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3300

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

Using diff file

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

Using Webrev

Link to Webrev Comment

cnqpzhang avatar Feb 27 '25 06:02 cnqpzhang

:wave: Welcome back qpzhang! 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.

bridgekeeper[bot] avatar Feb 27 '25 06:02 bridgekeeper[bot]

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

8350483: AArch64: turn on signum intrinsics by default on Ampere CPUs

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

  • 95fe05a32508fc2ac2eb235a236111e6b9a4eba7: 8136895: Writer not closed with disk full error, file resource leaked
  • f7492dda384b814c5fceaea15a2fdf1a2a7bc617: 8312475: org.jline.util.PumpReader signed byte problem
  • 4241313127be05704eeebcc6454120742cc93753: 8354941: Build failure with glibc 2.42 due to uabs() name collision
  • ... and 310 more: https://git.openjdk.org/jdk17u-dev/compare/fd353e38a820eed00b1a5f28e892a4d6baa3f1d1...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.

➡️ 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[bot] avatar Feb 27 '25 06:02 openjdk[bot]

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

openjdk[bot] avatar Feb 27 '25 06:02 openjdk[bot]

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

openjdk[bot] avatar Feb 27 '25 07:02 openjdk[bot]

Webrevs

mlbridge[bot] avatar Feb 27 '25 07:02 mlbridge[bot]

/approval request Resolved a merging conflict as the auto backport covered a piece of unrelated code change on CodeEntryAlignment. Right now, the updated commit has the exact same changes as f529bf71 from the openjdk/jdk repository. The change is simple and straight-forward, the change itself is safely limited to AArch64-port Ampere CPUs only, and well verified on Ampere-1A system, can be safe for backport. Please approve, thanks.

cnqpzhang avatar Feb 27 '25 07:02 cnqpzhang

@cnqpzhang 8350483: The approval request has been created successfully.

openjdk[bot] avatar Feb 27 '25 07:02 openjdk[bot]

Hi @cnqpzhang , can you please backport to 24 and 21 first? Removing the label in the meantime. Performance optimizations are not necessarily good candidates for backport to a rather old release.

GoeLin avatar Mar 03 '25 09:03 GoeLin

Hi @cnqpzhang , can you please backport to 24 and 21 first? Removing the label in the meantime. Performance optimizations are not necessarily good candidates for backport to a rather old release.

Thanks for your comments, @GoeLin . Sure I will request for backports to 24 and 21 firstly. It is not just a performance optimization, in the worst cases the slowdown caused by the performance issue showed 80~100x time cost of normal cases, as such the functions at 1~2% of the expected run speed got severely impacted in a manner.

cnqpzhang avatar Mar 04 '25 02:03 cnqpzhang

@cnqpzhang 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 add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Apr 01 '25 03:04 bridgekeeper[bot]

/approval cancel

cnqpzhang avatar Apr 01 '25 07:04 cnqpzhang

@cnqpzhang 8350483: The approval request has been cancelled successfully.

openjdk[bot] avatar Apr 01 '25 07:04 openjdk[bot]

Status update: backport to 24 has been done (merged), and the operation to 21 is waiting for a dependent change, and 17 would follow up.

cnqpzhang avatar Apr 01 '25 07:04 cnqpzhang

/approval request Should get backported to 17u for parity with 21u and 24u which have been done. Low risk and tier1 tests and other sanity checks pass on Ampere-1A systems. Initially intended as a performance optimization but later on found saving up to 80~100x performance defect in certain extreme cases. The issue severely impacted signum functions. Given that 17u is still extensively used by Java devs in practice, addressing this problem is essential to retore performance and maintain platform reliability. Thanks for approval.

cnqpzhang avatar Apr 10 '25 08:04 cnqpzhang

@cnqpzhang 8350483: The approval request has been created successfully.

openjdk[bot] avatar Apr 10 '25 08:04 openjdk[bot]

Hi @cnqpzhang Thanks for backporting to 21 and 24. One question: is this a regression? Can you name the change that cause the performance regression? Or is this a true optimization.

GoeLin avatar Apr 13 '25 18:04 GoeLin

Hi @cnqpzhang Thanks for backporting to 21 and 24. One question: is this a regression? Can you name the change that cause the performance regression? Or is this a true optimization.

Not a regression, the option was only enabled for some specific CPUs while this commit/backport extends its benefit to more.

cnqpzhang avatar Apr 14 '25 03:04 cnqpzhang

@cnqpzhang 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!

bridgekeeper[bot] avatar May 12 '25 06:05 bridgekeeper[bot]

/keepalive for approval and merge

cnqpzhang avatar May 14 '25 09:05 cnqpzhang

@cnqpzhang The pull request is being re-evaluated and the inactivity timeout has been reset.

openjdk[bot] avatar May 14 '25 09:05 openjdk[bot]

@cnqpzhang 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!

bridgekeeper[bot] avatar Jun 11 '25 14:06 bridgekeeper[bot]

/integrate

cnqpzhang avatar Jun 16 '25 07:06 cnqpzhang

@cnqpzhang Your change (at version 6f75fc9cd9e186858c8fcc3b31470c0bc1b2b87b) is now ready to be sponsored by a Committer.

openjdk[bot] avatar Jun 16 '25 07:06 openjdk[bot]

Hi @GoeLin , could you please help sponsor this and push? With sincere thanks.

cnqpzhang avatar Jun 19 '25 03:06 cnqpzhang

Hi, May I ask for any committer's help to push this approved PR? It’s been in the queue for about a week. Thanks so much in advance!

cnqpzhang avatar Jun 28 '25 10:06 cnqpzhang

Hi @cnqpzhang Can you find someone with expertise on aarch to sponsor this? It's the idea of sponsorship that a third person get's involved, if the backportee hasn't the necessary roles.

GoeLin avatar Jun 28 '25 12:06 GoeLin

@adinn Hi Andrew could you please help sponsor this onto jdk17u-dev? Many thanks.

cnqpzhang avatar Jun 29 '25 02:06 cnqpzhang

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

  • a897ee8cb0602d374d6bcbe7c28bf5d38b804e8b: 8351933: Inaccurate masking of TC subfield decrement in ForkJoinPool
  • 2dc6bac7bf3c39ad35b2db2c70d839130de036b9: 8328087: Automate javax/swing/JTable/TAB/TAB.java applet test
  • b5f7d6427c8b81f40d17222cf33c7b70da8bd395: 8203867: Delete test java/awt/TrayIcon/DblClickActionEventTest/DblClickActionEventTest.html
  • ... and 364 more: https://git.openjdk.org/jdk17u-dev/compare/fd353e38a820eed00b1a5f28e892a4d6baa3f1d1...master

Your commit was automatically rebased without conflicts.

openjdk[bot] avatar Jun 29 '25 09:06 openjdk[bot]

@theRealAph @cnqpzhang Pushed as commit c5f41eba4dc12fded813d7b6b302cc7a8f0b2e10.

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

openjdk[bot] avatar Jun 29 '25 09:06 openjdk[bot]