Skip to content

Conversation

@DingliZhang
Copy link
Member

@DingliZhang DingliZhang commented Sep 14, 2022

Follow up JDK-8280152, this case also exists in riscv.

Benchmark als, chi-square, dec-tree, log-regression, naive-bayes, page-rank, fj-kmeans, reactors, future-genetic, mnemonics, dotty, scala-kmeans, and finagle-http in Renaissance (0.14.1) are tested. The sum of the used size of CodeHeap 'non-profiled nmethods' and CodeHeap 'profiled nmethods' shows ~2.1% reduction on average.

Testing:

  • hotspot and jdk tier1 on unmatched board without new failures
  • hotspot/jtreg/compiler/sharedstubs/SharedTrampolineTest.java with fastdebug on qemu

Results

Results from Renaissance 0.14.1

  • riscv64
+--------------------------------------------------------------------------------------------------------+
|                |                     Before                |                    After                  |
|    Benchmark   |---------------------------------------------------------------------------------------| 
|                | non-profiled nmethods | profiled nmethods | non-profiled nmethods | profiled nmethods |
+----------------+-----------------------+-------------------+-----------------------+-------------------| 
| als            |                 15628 |             39421 |                 12341 |             26681 |
| chi-square     |                  6349 |             20268 |                  6033 |             20252 |
| dec-tree       |                 11058 |             42443 |                 10774 |             43880 |
| log-regression |                 10939 |             38237 |                 12071 |             44199 |
| naive-bayes    |                  9023 |             29563 |                  9294 |             30948 |
| page-rank      |                  6054 |             17041 |                  5812 |             17353 |
| fj-kmeans      |                   692 |              2893 |                   651 |              3354 |
| reactors       |                  2126 |              4073 |                  1876 |              4106 |
| future-genetic |                  1306 |              4118 |                  1226 |              4142 |
| mnemonics      |                   726 |              2659 |                   706 |              2684 |
| dotty          |                 26059 |             24417 |                 24585 |             25379 |
| scala-kmeans   |                   564 |              3122 |                   543 |              3132 |
| finagle-http   |                  6188 |             12455 |                  6102 |             12295 |
| sum            |                 96712 |            240710 |                 92014 |            238405 |
+--------------------------------------------------------------------------------------------------------+

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

Reviewers

Contributors

  • zifeihan <caogui@iscas.ac.cn>

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10260

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 14, 2022

👋 Welcome back dzhang! 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.

@DingliZhang
Copy link
Member Author

/contributor add zifeihan caogui@iscas.ac.cn

@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 14, 2022
@openjdk
Copy link

openjdk bot commented Sep 14, 2022

@DingliZhang zifeihan caogui@iscas.ac.cn is not a valid name and email string.

Syntax: /contributor (add|remove) [@user | openjdk-user | Full Name <email@address>]. For example:

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <duke@openjdk.org>

User names can only be used for users in the census associated with this repository. For other contributors you need to supply the full name and email address.

@openjdk
Copy link

openjdk bot commented Sep 14, 2022

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

  • hotspot

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 hotspot-dev@openjdk.org label Sep 14, 2022
@DingliZhang
Copy link
Member Author

/contributor add zifeihan caogui@iscas.ac.cn

@openjdk
Copy link

openjdk bot commented Sep 14, 2022

@DingliZhang
Contributor zifeihan <caogui@iscas.ac.cn> successfully added.

@mlbridge
Copy link

mlbridge bot commented Sep 14, 2022

Webrevs

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.

I have two comments here.

if (_shared_trampoline_requests == nullptr) {
constexpr unsigned init_size = 8;
constexpr unsigned max_size = 256;
_shared_trampoline_requests = new SharedTrampolineRequests(init_size, max_size);
Copy link
Member

Choose a reason for hiding this comment

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

I have the same concern here as [1]. Did you looked into it?

[1] #9405 (review)

Copy link
Member Author

Choose a reason for hiding this comment

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

When I run the benchmark in Renaissance (0.14.1), the default number of compiler threads is 15 (related to the number of CPUs) and I have not found this problem so far.

entry.rspec().type() == relocInfo::static_call_type ||
entry.rspec().type() == relocInfo::virtual_call_type, "wrong reloc type");

address target = entry.target();
Copy link
Member

@RealFYang RealFYang Sep 15, 2022

Choose a reason for hiding this comment

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

We call far_branches() and entry.target() more than once here in this function, which could be simplified.
I think we can set target according to result of far_branches() and plant a single jal(target) instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

We call far_branches() and entry.target() more than once here in this function, which could be simplified. I think we can set target according to result of far_branches() and plant a single jal(target) instead.

Done. Thanks for reviewing!

@openjdk
Copy link

openjdk bot commented Sep 15, 2022

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

8293770: RISC-V: Reuse runtime call trampolines

Co-authored-by: zifeihan <caogui@iscas.ac.cn>
Reviewed-by: fyang, shade

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:

  • 9dce865: 8294115: JNI local refs exceeds capacity warning in NetworkInterface::getAll
  • b030c7d: 8225235: Unused field defaultIndex in NetworkInterface
  • a07975b: 8294519: (fs) java/nio/file/Files/CopyProcFile.java fails intermittenly due to unstable /proc/cpuinfo output
  • 88062ee: 8293969: breakup the long signature in SystemDictionaryShared::is_supported_invokedynamic
  • aeef3ec: 8294198: Implement isFinite intrinsic for RISC-V
  • 5f6ad92: 8294547: HotSpotAgent.setupVM() should include "cause" exception when throwing DebuggerException
  • 545ded1: 8294548: Problem list SA core file tests on macosx-x64 due to JDK-8294316
  • 29c70f1: 8294595: Add javax/swing/plaf/aqua/CustomComboBoxFocusTest.java to problem list
  • 5d48da4: 8294370: Fix allocation bug in java_lang_Thread::async_get_stack_trace()
  • ce85cac: 8065554: MatchResult should provide values of named-capturing groups
  • ... and 41 more: https://git.openjdk.org/jdk/compare/49a7347ba5a0df58eeb7fb99dd0a4b067d77599e...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 (@RealFYang, @shipilev) 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 Sep 15, 2022
Copy link
Member

@feilongjiang feilongjiang left a comment

Choose a reason for hiding this comment

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

Copyright of codeBuffer_riscv.hpp should be update to 2022.

@DingliZhang
Copy link
Member Author

I have the same concern here as [1]. Did you looked into it?

[1] #9405 (review)

Hi @RealFYang Thank you for the comments!
Each CodeBuffer has its own independent _shared_trampoline_requests, which is a field of the CodeBuffer. The initialization process of _shared_trampoline_requests associated with the codebuffer can be seen in src/ hotspot/share/opto/output.cpp: PhaseOutput::Output() and each compiled task/thread have its own CodeBuffer to store the machine code, so multiple compiler threads will not share the buffer simultaneously.

@DingliZhang DingliZhang force-pushed the JDK-8280152-RISCV-20220913 branch from 0f46ec3 to de0fbed Compare September 27, 2022 01:57
@openjdk-notifier
Copy link

@DingliZhang Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information.

@DingliZhang
Copy link
Member Author

Copyright of codeBuffer_riscv.hpp should be update to 2022.

Hi @feilongjiang Thank you for the comments!
Maybe I should not need to update the copyright after I modify the file because I am not an employee of the above company.

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.

Updated change looks good.
Since this changes a shared test, better to have another review.
Maybe @shipilev ?

Copy link
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

The test change is pretty trivial, TBH. I have not looked into RISC-V parts.

@DingliZhang
Copy link
Member Author

@feilongjiang @RealFYang @shipilev Thanks for the review.
/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Sep 30, 2022
@openjdk
Copy link

openjdk bot commented Sep 30, 2022

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

@RealFYang
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Sep 30, 2022

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

  • 9dce865: 8294115: JNI local refs exceeds capacity warning in NetworkInterface::getAll
  • b030c7d: 8225235: Unused field defaultIndex in NetworkInterface
  • a07975b: 8294519: (fs) java/nio/file/Files/CopyProcFile.java fails intermittenly due to unstable /proc/cpuinfo output
  • 88062ee: 8293969: breakup the long signature in SystemDictionaryShared::is_supported_invokedynamic
  • aeef3ec: 8294198: Implement isFinite intrinsic for RISC-V
  • 5f6ad92: 8294547: HotSpotAgent.setupVM() should include "cause" exception when throwing DebuggerException
  • 545ded1: 8294548: Problem list SA core file tests on macosx-x64 due to JDK-8294316
  • 29c70f1: 8294595: Add javax/swing/plaf/aqua/CustomComboBoxFocusTest.java to problem list
  • 5d48da4: 8294370: Fix allocation bug in java_lang_Thread::async_get_stack_trace()
  • ce85cac: 8065554: MatchResult should provide values of named-capturing groups
  • ... and 41 more: https://git.openjdk.org/jdk/compare/49a7347ba5a0df58eeb7fb99dd0a4b067d77599e...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 30, 2022
@openjdk openjdk bot closed this Sep 30, 2022
@openjdk openjdk bot 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 Sep 30, 2022
@openjdk
Copy link

openjdk bot commented Sep 30, 2022

@RealFYang @DingliZhang Pushed as commit 7c60e6d.

💡 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

hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants