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

8295069: [PPC64] Performance regression after JDK-8290025 #10632

Conversation

TheRealMDoerr
Copy link
Contributor

@TheRealMDoerr TheRealMDoerr commented Oct 10, 2022

I have a proposal to mitigate the performance regression (see JBS issue) on PPC64 significantly. We get most of the performance back. Please review. Implemented like on aarch64, now. Also use 64 bit load for uint64_t _nmethod_disarm_value (not relevant for Little Endian).


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-8295069: [PPC64] Performance regression after JDK-8290025

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10632

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 10, 2022

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

@TheRealMDoerr
Copy link
Contributor Author

/label add gc

@TheRealMDoerr
Copy link
Contributor Author

/label add runtime

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

openjdk bot commented Oct 10, 2022

@TheRealMDoerr
The label gc is not a valid label.
These labels are valid:

  • serviceability
  • hotspot
  • hotspot-compiler
  • ide-support
  • kulla
  • i18n
  • shenandoah
  • jdk
  • javadoc
  • security
  • hotspot-runtime
  • jmx
  • build
  • nio
  • client
  • core-libs
  • compiler
  • net
  • hotspot-gc
  • hotspot-jfr

@openjdk
Copy link

openjdk bot commented Oct 10, 2022

@TheRealMDoerr
The label runtime is not a valid label.
These labels are valid:

  • serviceability
  • hotspot
  • hotspot-compiler
  • ide-support
  • kulla
  • i18n
  • shenandoah
  • jdk
  • javadoc
  • security
  • hotspot-runtime
  • jmx
  • build
  • nio
  • client
  • core-libs
  • compiler
  • net
  • hotspot-gc
  • hotspot-jfr

@TheRealMDoerr
Copy link
Contributor Author

/label add hotspot-gc

@openjdk
Copy link

openjdk bot commented Oct 10, 2022

@TheRealMDoerr 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 Oct 10, 2022
@TheRealMDoerr
Copy link
Contributor Author

/label add hotspot-runtime

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Oct 10, 2022
@mlbridge
Copy link

mlbridge bot commented Oct 10, 2022

Webrevs

@openjdk
Copy link

openjdk bot commented Oct 10, 2022

@TheRealMDoerr
The hotspot-gc label was successfully added.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Oct 10, 2022
@openjdk
Copy link

openjdk bot commented Oct 10, 2022

@TheRealMDoerr
The hotspot-runtime label was successfully added.

@TheRealMDoerr TheRealMDoerr changed the title 8295069: [PPC64, possibly aarch64] Performance regression after JDK-8290025 8295069: [PPC64] Performance regression after JDK-8290025 Oct 10, 2022
@TheRealMDoerr TheRealMDoerr marked this pull request as draft October 10, 2022 14:34
@TheRealMDoerr
Copy link
Contributor Author

Changed to draft. Aarch64 seems to have a better solution. I should probably implement it the same way.

@openjdk openjdk bot removed the rfr Pull request is ready for review label Oct 10, 2022
@nick-arm
Copy link
Member

This was fixed for AArch64 in JDK-8290700 - maybe it's worth adopting the NMethodPatchingType enum used there?

@TheRealMDoerr
Copy link
Contributor Author

Thanks for the hint! We had already noticed and I was working on it in the meantime.

@TheRealMDoerr TheRealMDoerr marked this pull request as ready for review October 10, 2022 15:04
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 10, 2022
@TheRealMDoerr
Copy link
Contributor Author

Note: conc_instruction_and_data_patch is for generational ZGC which is not yet in jdk master. PPC64 implementation will still work if we forget to update from conc_data_patch.

@theRealAph
Copy link
Contributor

Might it make sense for PPC to do what AArch64 does? We don't need any memory fence instructions on the fast path.

@TheRealMDoerr
Copy link
Contributor Author

Might it make sense for PPC to do what AArch64 does? We don't need any memory fence instructions on the fast path.

We are actually doing what AArch64 does, now. AArch64 still uses membar(__ LoadLoad) for (non-generational) ZGC and ShenandoahGC, because they use NMethodPatchingType::conc_data_patch. Other GCs don't need any memory fence instructions. (See BarrierSetAssembler::nmethod_entry_barrier.) Exactly like on PPC64, now.
Note that the patching epoch implementation is protected by NMethodPatchingType::conc_instruction_and_data_patch and is hence not used at all in jdk master. (Only in generational ZGC which is not yet integrated into jdk master.)

It may make sense to implement the patching epoch code on PPC64 as well. We could evaluate it, but we should better do that with generational ZGC (like on AArch64).

@theRealAph
Copy link
Contributor

Might it make sense for PPC to do what AArch64 does? We don't need any memory fence instructions on the fast path.

We are actually doing what AArch64 does, now. AArch64 still uses membar(__ LoadLoad) for (non-generational) ZGC and ShenandoahGC, because they use NMethodPatchingType::conc_data_patch. Other GCs don't need any memory fence instructions.

Ah, okay. On AArch64 we only issue a LoadLoad for conc_data_patch so I think we're good.

Copy link
Member

@reinrich reinrich left a comment

Choose a reason for hiding this comment

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

Changes look good!
Thanks, Richard.

@openjdk
Copy link

openjdk bot commented Oct 11, 2022

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

8295069: [PPC64] Performance regression after JDK-8290025

Reviewed-by: rrich, lucy

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

  • 9d0009e: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea.
  • 3ebe5ad: 8294751: Zero: Allow larger default heaps
  • 33d0618: 6616245: NullPointerException when using JFileChooser with a custom FileView
  • fba763f: 8291519: jdk/jfr/api/event/TestShouldCommit.java failed with Unexpected value of shouldCommit()
  • 6053bf0: 8293782: Shenandoah: some tests failed on lock rank check
  • 4435d56: 8282395: URL.openConnection can throw IOOBE
  • fe70487: 8294958: java/net/httpclient/ConnectTimeout tests are slow
  • 97f1321: 8294356: IGV: scheduled graphs contain duplicated elements
  • 5e05e42: 8294901: remove pre-VS2017 checks in Windows related coding
  • e775acf: 8293986: Incorrect double-checked locking in com.sun.beans.introspect.ClassInfo
  • ... and 6 more: https://git.openjdk.org/jdk/compare/4df4a1f8e238ebf49d4b0e1e102ccdc3cdb82de9...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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 11, 2022
@TheRealMDoerr
Copy link
Contributor Author

Thanks for reviewing!
Note: I have tested the new code on Big Endian linux as well. My latest commit avoids hitting the C++ barrier code unnecessarily often.

Copy link
Contributor

@RealLucy RealLucy left a comment

Choose a reason for hiding this comment

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

Changes look good to me.

@TheRealMDoerr
Copy link
Contributor Author

Thanks for the review!

@TheRealMDoerr
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 11, 2022

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

  • d362e16: 8294689: The SA transported_core.html file needs quite a bit of work
  • 07946aa: 8289552: Make intrinsic conversions between bit representations of half precision values and floats
  • 2586b1a: 8295155: Incorrect javadoc of java.base module
  • e1a77cf: 8295163: Remove old hsdis Makefile
  • 3c7ae12: 8294821: Class load improvement for AES crypto engine
  • 619cd82: 8294702: BufferedInputStream uses undefined value range for markpos
  • 9d0009e: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea.
  • 3ebe5ad: 8294751: Zero: Allow larger default heaps
  • 33d0618: 6616245: NullPointerException when using JFileChooser with a custom FileView
  • fba763f: 8291519: jdk/jfr/api/event/TestShouldCommit.java failed with Unexpected value of shouldCommit()
  • ... and 12 more: https://git.openjdk.org/jdk/compare/4df4a1f8e238ebf49d4b0e1e102ccdc3cdb82de9...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Oct 11, 2022
@openjdk openjdk bot closed this Oct 11, 2022
@TheRealMDoerr TheRealMDoerr deleted the 8295069_PPC64_nmethod_entry_no_isync branch October 11, 2022 19:21
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 11, 2022
@openjdk
Copy link

openjdk bot commented Oct 11, 2022

@TheRealMDoerr Pushed as commit 945950d.

💡 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 hotspot-gc hotspot-gc-dev@openjdk.org hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
5 participants