jdk icon indicating copy to clipboard operation
jdk copied to clipboard

8290981: Enable CDS for zero builds

Open iklam opened this issue 2 years ago • 12 comments

Enable CDS for zero builds. java --version is about 2x faster now.

$ perf stat -r 40 ./images/jdk/bin/java -Xshare:off -version
0.034645 +- 0.000044 seconds time elapsed  ( +-  0.13% )
$ perf stat -r 40 ./images/jdk/bin/java -version
0.018080 +- 0.000388 seconds time elapsed  ( +-  2.15% )

I also fixed a bug in Images.gmk that always wrote the default archive to $JAVA_HOME/lib/server. This fix also makes it possible for a client libjvm to have a default CDS archive.


Progress

  • [x] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • [x] Change must not contain extraneous whitespace
  • [x] Commit message must refer to an issue

Issue

Reviewers

Contributors

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9869

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

Using diff file

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

iklam avatar Aug 14 '22 05:08 iklam

:wave: Welcome back iklam! 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.

bridgekeeper[bot] avatar Aug 14 '22 05:08 bridgekeeper[bot]

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

  • build
  • hotspot

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[bot] avatar Aug 14 '22 05:08 openjdk[bot]

Good stuff. Actually, let me see how easy it is to implement the nofast_* bytecodes in Zero, so we don't have to do the shared-code exceptions for it.

shipilev avatar Aug 15 '22 07:08 shipilev

Good stuff. Actually, let me see how easy it is to implement the nofast_* bytecodes in Zero, so we don't have to do the shared-code exceptions for it.

That took some debugging :) But here it is, applied on top of your PR: https://cr.openjdk.java.net/~shade/8290981/zero-cds-nofast-1.patch -- builds Linux x86_64 Zero fine, this includes using the Zero VM to compile parts of JDK. I can do more testing later, we should at least test it bootcycles well.

shipilev avatar Aug 15 '22 11:08 shipilev

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

8290981: Enable CDS for zero builds

Co-authored-by: Aleksey Shipilev <[email protected]>
Reviewed-by: erikj, shade, ihse

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

  • 37aa7c165dac13b7d6bb2b3c9814e1ec3fc4a730: 8292559: Add test for -XX:+CheckJNICalls showing changed signal handlers
  • f2f0cd86bf4dce4633f484476077fd090549780e: 8292511: AArch64: Align CPU feature name for NEON with hwcap
  • 1f484dae4efaa60cf18a3d4df947c05f1497bd5b: 8289562: Change bugs.java.com and bugreport.java.com URL's to https
  • 63a126aa2d6d7645c9cac6d3f9f0b87473cf7478: 8292607: Remove unused dirty and dirty_card_range_after_reset in CardTable
  • 7d18ebd870bb6aa409fd4e7b622400fd9a8f7d30: 8292606: G1 and Epsilon header cleanup for JDK-8282729
  • 2edd5501054df5792316bcd32208e603d43951c4: 8292312: Work around memset() called operator new
  • 964aac28fe4a33f9e86cc07895a7ff4cdbaec3e6: 8292499: CDS ArchivedEnumTest.java fails: object points to a static field that may be reinitialized
  • f85411f24a0cf55f8718aadd2297d95feb95564b: 8292458: Atomic operations on scoped enums don't build with clang
  • 82dbe29fc8327f6992703f54181c3e42beb99ccf: 8292633: runtime/cds/appcds/dynamicArchive/CDSStreamTestDriver.java fails to compile
  • 54ce11431d194c23d3b674bcc54be1acf94e7f89: 6587699: Document DigestInputStream behavior when skip() or mark() / reset() is used
  • ... and 40 more: https://git.openjdk.org/jdk/compare/ea2c82e74f5580f396920f9e561cbec80c03f373...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[bot] avatar Aug 15 '22 12:08 openjdk[bot]

Good stuff. Actually, let me see how easy it is to implement the nofast_* bytecodes in Zero, so we don't have to do the shared-code exceptions for it.

That took some debugging :) But here it is, applied on top of your PR: https://cr.openjdk.java.net/~shade/8290981/zero-cds-nofast-1.patch -- builds Linux x86_64 Zero fine, this includes using the Zero VM to compile parts of JDK. I can do more testing later, we should at least test it bootcycles well.

Passes Linux x86_64 fastdebug Zero make bootcycle-images too.

shipilev avatar Aug 15 '22 17:08 shipilev

@shipilev thanks for sending the patch. I've integrated it. I ran all the tests under test/hotspot/jtreg/runtime/cds/appcds. They all passed after I fixed two of the test cases.

Do you know how much testing is done by the community with zero? We don't test it that much in our pipeline.

iklam avatar Aug 15 '22 18:08 iklam

/contributor @shipilev

iklam avatar Aug 15 '22 18:08 iklam

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

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <[email protected]>

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[bot] avatar Aug 15 '22 18:08 openjdk[bot]

/contributor add @shipilev

iklam avatar Aug 15 '22 20:08 iklam

@iklam Contributor Aleksey Shipilev <[email protected]> successfully added.

openjdk[bot] avatar Aug 15 '22 20:08 openjdk[bot]

Do you know how much testing is done by the community with zero? We don't test it that much in our pipeline.

You could ask the Debian people (Adrian Glaubitz), IIRC they have test farms with broad platform support and use a lot of zero.

tstuefe avatar Aug 16 '22 05:08 tstuefe

Do you know how much testing is done by the community with zero? We don't test it that much in our pipeline.

You could ask the Debian people (Adrian Glaubitz), IIRC they have test farms with broad platform support and use a lot of zero.

Yes, Debian seems to rely on Zero for many arches that do not have Server ports. They discover the bugs sometimes, but I think it got much better once we started doing x86_64 Zero bootcycle tests for incoming Zero patches -- it shakes out a lot of simple bugs.

shipilev avatar Aug 16 '22 06:08 shipilev

Do you know how much testing is done by the community with zero? We don't test it that much in our pipeline.

You could ask the Debian people (Adrian Glaubitz), IIRC they have test farms with broad platform support and use a lot of zero.

@glaubitz, could you try out this PR and see if it might introduce any regressions? I'd really appreciate your help.

iklam avatar Aug 16 '22 16:08 iklam

@shipilev Thanks for the code contribution and testing! @tstuefe @magicus @erikj79 Thanks for the review. /integrate

iklam avatar Aug 19 '22 18:08 iklam

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

  • 6a8a531359295849113aa14fd6cba21c886decf3: 8292564: x86: Remove redundant casts in Assembler usages
  • 7244dd6fab0c516ed76af594593b8378512620c8: 8292267: Clean up synchronizer.hpp
  • 1f3578b79c6355b976d64756da7e4a8af32c2987: 8292446: Make TableRateStatistics optional in CHT
  • 45dec480ef6f1d5509f4afbbf414c69584ac252e: 8292592: JFR test TestNative is not reliable due to low rate of sampling.
  • 58aae340a9892889ef8784ef9360bb7e0af85ddd: 8292576: Improve wording of AccessFlag-related specs
  • 5ca268ca65f3619139abeddd1070306db406ccc1: 8292636: (dc) Problem listing of java/nio/channels/DatagramChannel/Unref.java has incorrect issue ID
  • 37aa7c165dac13b7d6bb2b3c9814e1ec3fc4a730: 8292559: Add test for -XX:+CheckJNICalls showing changed signal handlers
  • f2f0cd86bf4dce4633f484476077fd090549780e: 8292511: AArch64: Align CPU feature name for NEON with hwcap
  • 1f484dae4efaa60cf18a3d4df947c05f1497bd5b: 8289562: Change bugs.java.com and bugreport.java.com URL's to https
  • 63a126aa2d6d7645c9cac6d3f9f0b87473cf7478: 8292607: Remove unused dirty and dirty_card_range_after_reset in CardTable
  • ... and 46 more: https://git.openjdk.org/jdk/compare/ea2c82e74f5580f396920f9e561cbec80c03f373...master

Your commit was automatically rebased without conflicts.

openjdk[bot] avatar Aug 19 '22 19:08 openjdk[bot]

@iklam Pushed as commit 57aac2ab6569c18a56e9a36f174bb0bf09955f83.

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

openjdk[bot] avatar Aug 19 '22 19:08 openjdk[bot]