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

8329433: Reduce nmethod header size #18768

Closed
wants to merge 9 commits into from
Closed

Conversation

vnkozlov
Copy link
Contributor

@vnkozlov vnkozlov commented Apr 12, 2024

This is part of changes which try to reduce size of nmethod and codeblob data vs code in CodeCache.
These changes reduced size of nmethod header from 288 to 232 bytes. From 304 to 248 in optimized VM:

Statistics for 1282 bytecoded nmethods for C2:
 total in heap = 5560352 (100%)
 header = 389728 (7.009053%)

vs

Statistics for 1322 bytecoded nmethods for C2:
 total in heap  = 8307120 (100%)
 header         = 327856 (3.946687%)

Several unneeded fields in nmethod and CodeBlob were removed. Some fields were changed from int to int16_t with added corresponding asserts to make sure their values are fit into 16 bits.

I did additional cleanup after recent CompiledMethod removal.

Tested tier1-7,stress,xcomp and performance testing.


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-8329433: Reduce nmethod header size (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 18768

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 12, 2024

👋 Welcome back kvn! 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 Apr 12, 2024

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

8329433: Reduce nmethod header size

Reviewed-by: dlong, iveresov

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

  • 3c1d1d9: 8320522: Remove code related to RegisterFinalizersAtInit
  • 650ca65: 8329330: NoClassDefFoundError: Could not initialize class jdk.jfr.internal.MirrorEvents
  • 177092b: 8330569: Rename Nix to Posix in platform-dependent attachListener code
  • eb60822: 8310072: JComboBox/DisabledComboBoxFontTestAuto: Enabled and disabled ComboBox does not match in these LAFs: GTK+
  • 85261bc: 8330266: RISC-V: Restore frm to RoundingMode::rne after JNI
  • 9f2a4fa: 8330572: jdk.internal.net.http.HttpConnection calls an expensive checkOpen() when returning a HTTP/1.1 connection to the pool
  • 8990864: 8330156: RISC-V: Range check auipc + signed 12 imm instruction
  • 46a2ce4: 8330063: Upgrade jQuery to 3.7.1
  • 252c62a: 8330524: Linux ppc64le compile warning with clang in os_linux_ppc.cpp
  • 32946e1: 8295111: dpkg appears to have problems resolving symbolically linked native libraries
  • ... and 14 more: https://git.openjdk.org/jdk/compare/064628471b83616b4463baa78618d1b7a66d0c7c...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 rfr Pull request is ready for review label Apr 12, 2024
@openjdk
Copy link

openjdk bot commented Apr 12, 2024

@vnkozlov The following labels will be automatically applied to this pull request:

  • graal
  • hotspot
  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added graal graal-dev@openjdk.org serviceability serviceability-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels Apr 12, 2024
@mlbridge
Copy link

mlbridge bot commented Apr 12, 2024

src/hotspot/share/code/codeBlob.cpp Show resolved Hide resolved
src/hotspot/share/code/codeBlob.cpp Show resolved Hide resolved
src/hotspot/share/code/codeBlob.cpp Show resolved Hide resolved
src/hotspot/share/code/codeBlob.hpp Show resolved Hide resolved
src/hotspot/share/code/debugInfoRec.cpp Show resolved Hide resolved
src/hotspot/share/code/nmethod.hpp Show resolved Hide resolved
src/hotspot/share/code/nmethod.hpp Show resolved Hide resolved
src/hotspot/share/code/nmethod.hpp Show resolved Hide resolved
src/hotspot/share/memory/heap.hpp Show resolved Hide resolved
src/hotspot/share/runtime/frame.cpp Show resolved Hide resolved
Copy link
Contributor Author

@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.

@dean-long, thank you for review. I applied all your suggestions and push it after testing.

src/hotspot/share/code/nmethod.cpp Outdated Show resolved Hide resolved
src/hotspot/share/code/nmethod.cpp Outdated Show resolved Hide resolved
src/hotspot/share/code/nmethod.cpp Outdated Show resolved Hide resolved
src/hotspot/share/code/nmethod.cpp Outdated Show resolved Hide resolved
src/hotspot/share/code/nmethod.cpp Outdated Show resolved Hide resolved
src/hotspot/share/code/nmethod.cpp Outdated Show resolved Hide resolved
src/hotspot/share/memory/heap.hpp Outdated Show resolved Hide resolved
src/hotspot/share/memory/heap.hpp Outdated Show resolved Hide resolved
@openjdk openjdk bot removed the rfr Pull request is ready for review label Apr 17, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 17, 2024
@vnkozlov vnkozlov requested a review from dean-long April 17, 2024 15:58
@vnkozlov
Copy link
Contributor Author

Merge #18637 added an other short field _num_stack_arg_slots which pushed nmethod size back to 240 bytes in product VM. I will not do changes in this PR to compensate it.

@vnkozlov
Copy link
Contributor Author

I remove ASSERT blocks to address the last @dean-long comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 18, 2024
@vnkozlov
Copy link
Contributor Author

Waiting second review.

Copy link
Contributor

@veresov veresov 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.

@vnkozlov
Copy link
Contributor Author

Thank you @dean-long, @coleenp, @JohnTortugo and @veresov for reviews.

@vnkozlov
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Apr 19, 2024

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

  • 8da175d: 8330008: [s390x] Test bit "in-memory" in case of DiagnoseSyncOnValueBasedClasses
  • 3c1d1d9: 8320522: Remove code related to RegisterFinalizersAtInit
  • 650ca65: 8329330: NoClassDefFoundError: Could not initialize class jdk.jfr.internal.MirrorEvents
  • 177092b: 8330569: Rename Nix to Posix in platform-dependent attachListener code
  • eb60822: 8310072: JComboBox/DisabledComboBoxFontTestAuto: Enabled and disabled ComboBox does not match in these LAFs: GTK+
  • 85261bc: 8330266: RISC-V: Restore frm to RoundingMode::rne after JNI
  • 9f2a4fa: 8330572: jdk.internal.net.http.HttpConnection calls an expensive checkOpen() when returning a HTTP/1.1 connection to the pool
  • 8990864: 8330156: RISC-V: Range check auipc + signed 12 imm instruction
  • 46a2ce4: 8330063: Upgrade jQuery to 3.7.1
  • 252c62a: 8330524: Linux ppc64le compile warning with clang in os_linux_ppc.cpp
  • ... and 15 more: https://git.openjdk.org/jdk/compare/064628471b83616b4463baa78618d1b7a66d0c7c...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Apr 19, 2024
@openjdk openjdk bot closed this Apr 19, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Apr 19, 2024
@openjdk
Copy link

openjdk bot commented Apr 19, 2024

@vnkozlov Pushed as commit b704e91.

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

@vnkozlov vnkozlov deleted the 8329433 branch April 19, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
graal graal-dev@openjdk.org hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated serviceability serviceability-dev@openjdk.org
5 participants