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

8269598: Regressions up to 5% on aarch64 seems due to JDK-8268858 #4766

Closed
wants to merge 1 commit into from

Conversation

JoshuaZhuwj
Copy link
Member

@JoshuaZhuwj JoshuaZhuwj commented Jul 13, 2021

Hi,

Please review this change.
It fixes the SPECjvm2008 regression on aarch64 caused by JDK-8268858.

Compressor::compress() in case "compress" of SPECjvm2008 performed
degraded by 5% due to extra spillings. There existed an LRG that covered
almost the entire function, hence it interfered with more live ranges.
These interferences caused the LRG no freedom and lastly RA had to spill
it to stack. After the fix, the LRG is split into two shorter live
ranges. Both LRGs are assigned to registers due to fewer interferences.

See details at: http://cr.openjdk.java.net/~jzhu/8269598/analysis.pdf
OptoAssembly: http://cr.openjdk.java.net/~jzhu/8269598/

The root cause is:
When PreserveFramePointer is off, frame pointer is allocatable, but
different from other SOC registers, it is excluded from fatproj's mask
because its save type is No-Save. Therefore fatproj was not treated as
high-pressure transition point in the previous int_pressure_limit()
computation. This fix ensures high pressure at fatproj when
PreserveFramePointer is off. See check_pressure_at_fatproj() [1].

After this fix, the regression disappeared.
The result of regression cases in SPECjvm2008:
http://cr.openjdk.java.net/~jzhu/8269598/Book1.pdf

[1]

void check_pressure_at_fatproj(uint fatproj_location, RegMask& fatproj_mask) {

Best Regards,
Joshua


Progress

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

Issue

  • JDK-8269598: Regressions up to 5% on aarch64 seems due to JDK-8268858

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4766/head:pull/4766
$ git checkout pull/4766

Update a local copy of the PR:
$ git checkout pull/4766
$ git pull https://git.openjdk.java.net/jdk pull/4766/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4766

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4766.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 13, 2021

👋 Welcome back jzhu! 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 Pull request is ready for review label Jul 13, 2021
@openjdk
Copy link

openjdk bot commented Jul 13, 2021

@JoshuaZhuwj 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 hotspot-compiler-dev@openjdk.org label Jul 13, 2021
@mlbridge
Copy link

mlbridge bot commented Jul 13, 2021

Webrevs

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Good.

@openjdk
Copy link

openjdk bot commented Jul 13, 2021

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

8269598: Regressions up to 5% on aarch64 seems due to JDK-8268858

Reviewed-by: kvn, dlong

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

  • 7d0edb5: Merge
  • 7b4d84c: 8270422: Test build/AbsPathsInImage.java fails after JDK-8259848
  • 72db09b: 8266313: (JEP-356) - RandomGenerator spec implementation requirements tightly coupled to JDK internal classes
  • 3bbd233: 8270075: SplittableRandom extends AbstractSplittableGenerator
  • 381bd62: 8266889: [macosx-aarch64] Crash with SIGBUS in MarkActivationClosure::do_code_blob during vmTestbase/nsk/jvmti/.../bi04t002 test run
  • 82c256e: 8259499: Handling type arguments from outer classes for inner class in javadoc
  • e5db9a9: 8268620: InfiniteLoopException test may fail on x86 platforms
  • 67273ae: 8269865: Async UL needs to handle ERANGE on exceeding SEM_VALUE_MAX
  • 0f54707: 8270056: Generated lambda class can not access protected static method of target class
  • a033866: 8269637: javax/swing/JFileChooser/FileSystemView/SystemIconTest.java fails on windows
  • ... and 29 more: https://git.openjdk.java.net/jdk/compare/07e90524576f159fc16523430f1db62327c89a3b...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 (@vnkozlov, @dean-long) 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 Pull request is ready to be integrated label Jul 13, 2021
Copy link
Member

@dean-long dean-long left a comment

Choose a reason for hiding this comment

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

I don't understand why aarcht64 needs these adjustments but x86 does not. Both are doing the same tricks with PreserveFramePointer, right?

@JoshuaZhuwj
Copy link
Member Author

I don't understand why aarcht64 needs these adjustments but x86 does not. Both are doing the same tricks with PreserveFramePointer, right?

Yes. If make the same adjustment on x86, the same wide LRG in
Compressor::compress() will also be split and be assigned to register
just like aarch64.

But this adjustment is a trade-off in my opinion. Lowering pressure
threshold would also bring unnecessary spillings in some scenarios,
result in performance degradation especially on x86 platform that has
a small quantity of GPRs. On aarch64 that has more GPRs, the benefits
of lowering pressure threshold by 1 or 2 outweigh the disadvantages.

I also performed the same SPECjvm2018 "compress" test on x86_64.
Compared to 5% performance improvement on aarch64, the same adjustment
degraded performance by 1.28% nevertheless.

@JoshuaZhuwj
Copy link
Member Author

Thanks @vnkozlov @dean-long for your review.

@JoshuaZhuwj
Copy link
Member Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jul 15, 2021
@openjdk
Copy link

openjdk bot commented Jul 15, 2021

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

@y1yang0
Copy link
Member

y1yang0 commented Jul 15, 2021

/sponsor

@openjdk
Copy link

openjdk bot commented Jul 15, 2021

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

  • 7d0edb5: Merge
  • 7b4d84c: 8270422: Test build/AbsPathsInImage.java fails after JDK-8259848
  • 72db09b: 8266313: (JEP-356) - RandomGenerator spec implementation requirements tightly coupled to JDK internal classes
  • 3bbd233: 8270075: SplittableRandom extends AbstractSplittableGenerator
  • 381bd62: 8266889: [macosx-aarch64] Crash with SIGBUS in MarkActivationClosure::do_code_blob during vmTestbase/nsk/jvmti/.../bi04t002 test run
  • 82c256e: 8259499: Handling type arguments from outer classes for inner class in javadoc
  • e5db9a9: 8268620: InfiniteLoopException test may fail on x86 platforms
  • 67273ae: 8269865: Async UL needs to handle ERANGE on exceeding SEM_VALUE_MAX
  • 0f54707: 8270056: Generated lambda class can not access protected static method of target class
  • a033866: 8269637: javax/swing/JFileChooser/FileSystemView/SystemIconTest.java fails on windows
  • ... and 29 more: https://git.openjdk.java.net/jdk/compare/07e90524576f159fc16523430f1db62327c89a3b...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Jul 15, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and 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 Jul 15, 2021
@openjdk
Copy link

openjdk bot commented Jul 15, 2021

@kelthuzadx @JoshuaZhuwj Pushed as commit 7c23491.

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

@dean-long
Copy link
Member

@JoshuaZhuwj Please try SPECjvm2008 compress on x86/x64 with -XX:+PreserveFramePointer. We are seeing a regression after JDK-8268858.

@JoshuaZhuwj
Copy link
Member Author

@dean-long Thanks for your information. Previously I already found performance degradation with -XX:+PreserveFramePointer in Alibaba Flink Nexmark benchmark. It's caused by inefficient codes generated by RA. That's why I begin working on register pressure. I already created JDK-8270808 [1] to track it. Meanwhile I will also track your mentioned regression issue together with it. Hope they're caused by the same reason.

[1] https://bugs.openjdk.java.net/browse/JDK-8270808

@JoshuaZhuwj
Copy link
Member Author

@JoshuaZhuwj Please try SPECjvm2008 compress on x86/x64 with -XX:+PreserveFramePointer. We are seeing a regression after JDK-8268858.

Just now I ran six rounds of "compress" on x64 machine with "-XX:+PreserveFramePointer".
Thread number of "compress" test is configured as 1 in my testing environment.
See result at http://cr.openjdk.java.net/~jzhu/8269598/Book2_x86.pdf
There is no regression in my testing. How about yours?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
4 participants