Skip to content

8322583: RISC-V: Enable fast class initialization checks #17192

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

Closed
wants to merge 1 commit into from

Conversation

zifeihan
Copy link
Member

@zifeihan zifeihan commented Dec 26, 2023

Hi, Please review this small change enabling fast class initialization checks on linux-riscv. As discussed on [1], we noticed that VM_Version::supports_fast_class_init_checks is false on linux-riscv64 platform. But the needed code of this optimization on this platform is there which is supposed to solve a performance issue https://bugs.openjdk.org/browse/JDK-8219233 at that time. I found that this performance issue is still reproduciable on linux-riscv64. And the original performance issue reported by JDK-8219233 is resolved when this optimization is enabled (x2.5 improvement for reported case on linux-riscv64).

Once this is in, I'd like to request approval for backporting to JDK 21u and JDK 17u since corresponding fixes for the other ports are already there, unless the community feels otherwise.

[1] #17006 (comment)

OpenJDK23 linux-riscv64 when setting VM_Version::supports_fast_class_init_checks returns false(default):

$ clojure -A:user
"Elapsed time: 91597.717028 msecs"
$ clojure -A:user
"Elapsed time: 91851.01435 msecs"
$ clojure -A:user
"Elapsed time: 92149.106378 msecs"
$ clojure foo.clj
"Elapsed time: 35663.36249 msecs"
$ clojure foo.clj
"Elapsed time: 35677.387338 msecs"
$ clojure foo.clj
"Elapsed time: 35253.330701 msecs"

OpenJDK23 linux-riscv64 when setting VM_Version::supports_fast_class_init_checks returns true:

$ clojure -A:user
"Elapsed time: 37425.063258 msecs"
$ clojure -A:user
"Elapsed time: 36338.252422 msecs"
$ clojure -A:user
"Elapsed time: 37441.73001 msecs"
$ clojure foo.clj
"Elapsed time: 36018.857489 msecs"
$ clojure foo.clj
"Elapsed time: 34750.533297 msecs"
$ clojure foo.clj
"Elapsed time: 35499.890121 msecs"

Testing:

  • Run tier1-3 tests on qemu 8.1.0 with UseRVV (fastdebug)
  • Run tier1-3 tests on qemu 8.1.0 with UseRVV (release)
  • Run tier1-3, hotspot:tier4 tests with SiFive unmatched (release)

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

  • JDK-8322583: RISC-V: Enable fast class initialization checks (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 17192

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 26, 2023

👋 Welcome back gcao! 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
Copy link

openjdk bot commented Dec 26, 2023

@zifeihan 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 Dec 26, 2023
Copy link
Contributor

@robehn robehn left a comment

Choose a reason for hiding this comment

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

Thanks!

Oh, it was only in draft :)

@zifeihan zifeihan marked this pull request as ready for review January 2, 2024 01:46
@openjdk
Copy link

openjdk bot commented Jan 2, 2024

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

8322583: RISC-V: Enable fast class initialization checks

Reviewed-by: rehn, fyang, fjiang

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

  • 3b1e56a: 8322322: Support archived full module graph when -Xbootclasspath/a is used
  • 3fbccb0: 8322978: Remove debug agent debugMonitorTimedWait() function. It is no longer used.
  • ad31ec5: 8322647: Short name for the Europe/Lisbon time zone is incorrect
  • 15cf8f8: 8319626: Override toString() for ZipFile
  • ade4074: 8322976: Remove reference to transform_no_reclaim
  • ea19e9c: 8323011: ProblemList serviceability/HeapDump/FullGCHeapDumpLimitTest.java
  • d33dfe5: 8323002: test/jdk/java/lang/Thread/virtual/stress/GetStackTraceALotWhenPinned.java times out on macosx-x64
  • 27d5f5c: 8322781: C1: Debug build crash in GraphBuilder::vmap() when print stats
  • df22fb3: 8322512: StringBuffer.repeat does not work correctly after toString() was called
  • c3cd1f1: 8323000: Parallel: Remove unused class declarations in psScavenge
  • ... and 47 more: https://git.openjdk.org/jdk/compare/4fc6b0ffa4f771991a5ebd982b5133d2e364fdae...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 (@robehn, @RealFYang, @feilongjiang) 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 ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 2, 2024
@mlbridge
Copy link

mlbridge bot commented Jan 2, 2024

Webrevs

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.

Looks good, thanks!

@zifeihan
Copy link
Member Author

zifeihan commented Jan 5, 2024

Thanks all for the review.
/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jan 5, 2024
@openjdk
Copy link

openjdk bot commented Jan 5, 2024

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

@RealFYang
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Jan 5, 2024

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

  • 3b1e56a: 8322322: Support archived full module graph when -Xbootclasspath/a is used
  • 3fbccb0: 8322978: Remove debug agent debugMonitorTimedWait() function. It is no longer used.
  • ad31ec5: 8322647: Short name for the Europe/Lisbon time zone is incorrect
  • 15cf8f8: 8319626: Override toString() for ZipFile
  • ade4074: 8322976: Remove reference to transform_no_reclaim
  • ea19e9c: 8323011: ProblemList serviceability/HeapDump/FullGCHeapDumpLimitTest.java
  • d33dfe5: 8323002: test/jdk/java/lang/Thread/virtual/stress/GetStackTraceALotWhenPinned.java times out on macosx-x64
  • 27d5f5c: 8322781: C1: Debug build crash in GraphBuilder::vmap() when print stats
  • df22fb3: 8322512: StringBuffer.repeat does not work correctly after toString() was called
  • c3cd1f1: 8323000: Parallel: Remove unused class declarations in psScavenge
  • ... and 47 more: https://git.openjdk.org/jdk/compare/4fc6b0ffa4f771991a5ebd982b5133d2e364fdae...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jan 5, 2024

@RealFYang @zifeihan Pushed as commit 5235cc9.

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

@zifeihan
Copy link
Member Author

zifeihan commented Jan 5, 2024

/backport jdk21u-dev

@openjdk
Copy link

openjdk bot commented Jan 5, 2024

@zifeihan the backport was successfully created on the branch backport-zifeihan-5235cc98 in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 5235cc98 from the openjdk/jdk repository.

The commit being backported was authored by Gui Cao on 5 Jan 2024 and was reviewed by Robbin Ehn, Fei Yang and Feilong Jiang.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u-dev:

$ git fetch https://github.com/openjdk-bots/jdk21u-dev.git backport-zifeihan-5235cc98:backport-zifeihan-5235cc98
$ git checkout backport-zifeihan-5235cc98
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u-dev.git backport-zifeihan-5235cc98

@zifeihan zifeihan deleted the JDK-8322583 branch January 23, 2024 05:58
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