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

8316415: Parallelize sun/security/rsa/SignedObjectChain.java subtests #15860

Closed
wants to merge 4 commits into from

Conversation

msobiers
Copy link
Contributor

@msobiers msobiers commented Sep 21, 2023

sun/security/rsa/SignedObjectChain.java is very slow when run with C1, I suspect because some crypto intrinsics are only implemented in C2. Commit contains changes made to parallelize it.

Comparison of before and after parallelization:
time make test TEST=jdk/sun/security/rsa/SignedObjectChain.java TEST_VM_OPTS="-XX:+UseParallelGC -XX:TieredStopAtLevel=1"
before: 270.72s user 4.88s system 108% cpu 4:14.43 total
after: 410.76s user 7.50s system 555% cpu 1:15.23 total
after second commit: 375.46s user 4.59s system 539% cpu 1:10.41 total

time make test TEST=jdk/sun/security/rsa/SignedObjectChain.java TEST_VM_OPTS="-XX:+UseParallelGC"
before: 63.67s user 4.67s system 161% cpu 42.424 total
after: 130.36s user 7.47s system 585% cpu 23.526 total
after second commit: 67.31s user 4.48s system 417% cpu 17.183 total

time make test TEST=jdk/sun/security/rsa/SignedObjectChain.java TEST_VM_OPTS="-XX:+UseShenandoahGC -XX:TieredStopAtLevel=1"
before: 281.99s user 5.54s system 108% cpu 4:24.09 total
after: 386.98s user 8.62s system 496% cpu 1:19.73 total
after second commit: 413.51s user 5.08s system 613% cpu 1:08.25 total

time make test TEST=jdk/sun/security/rsa/SignedObjectChain.java TEST_VM_OPTS="-XX:+UseShenandoahGC"
before: 65.86s user 5.05s system 156% cpu 45.215 total
after: 135.90s user 7.66s system 585% cpu 24.502 total
after second commit: 83.25s user 4.82s system 469% cpu 18.741 total


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8316415: Parallelize sun/security/rsa/SignedObjectChain.java subtests (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15860

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

Using diff file

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

Webrev

Link to Webrev Comment

sun/security/rsa/SignedObjectChain.java is very slow when run with C1, I
suspect because some crypto intrinsics are only implemented in C2.
Commit contains changes made to parallelize
sun/security/rsa/SignedObjectChain.java

Comparison of before and after parallelization:
time make test TEST=jdk/sun/security/rsa/SignedObjectChain.java
TEST_VM_OPTS="-XX:+UseParallelGC -XX:TieredStopAtLevel=1"
before:   270.72s user 4.88s system 108% cpu 4:14.43 total
after:   410.76s user 7.50s system 555% cpu 1:15.23 total

time make test TEST=jdk/sun/security/rsa/SignedObjectChain.java
TEST_VM_OPTS="-XX:+UseParallelGC"
before:   63.67s user 4.67s system 161% cpu 42.424 total
after:   130.36s user 7.47s system 585% cpu 23.526 total

time make test TEST=jdk/sun/security/rsa/SignedObjectChain.java
TEST_VM_OPTS="-XX:+UseShenandoahGC -XX:TieredStopAtLevel=1"
before:   281.99s user 5.54s system 108% cpu 4:24.09 total
after:   386.98s user 8.62s system 496% cpu 1:19.73 total

time make test TEST=jdk/sun/security/rsa/SignedObjectChain.java
TEST_VM_OPTS="-XX:+UseShenandoahGC"
before:   65.86s user 5.05s system 156% cpu 45.215 total
after:   135.90s user 7.66s system 585% cpu 24.502 total
@msobiers
Copy link
Contributor Author

/covered

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 21, 2023

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

bridgekeeper bot commented Sep 21, 2023

You are already a known contributor!

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

openjdk bot commented Sep 21, 2023

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

  • security

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 security security-dev@openjdk.org label Sep 21, 2023
@mlbridge
Copy link

mlbridge bot commented Sep 21, 2023

Webrevs

time make test TEST=jdk/sun/security/rsa/SignedObjectChain.java
TEST_VM_OPTS="-XX:+UseParallelGC -XX:TieredStopAtLevel=1"
before:   270.72s user 4.88s system 108% cpu 4:14.43 total
after:   375.46s user 4.59s system 539% cpu 1:10.41 total

time make test TEST=jdk/sun/security/rsa/SignedObjectChain.java
TEST_VM_OPTS="-XX:+UseParallelGC"
before:   63.67s user 4.67s system 161% cpu 42.424 total
after:   67.31s user 4.48s system 417% cpu 17.183 total

time make test TEST=jdk/sun/security/rsa/SignedObjectChain.java
TEST_VM_OPTS="-XX:+UseShenandoahGC -XX:TieredStopAtLevel=1"
before:   281.99s user 5.54s system 108% cpu 4:24.09 total
after:   413.51s user 5.08s system 613% cpu 1:08.25 total

time make test TEST=jdk/sun/security/rsa/SignedObjectChain.java
TEST_VM_OPTS="-XX:+UseShenandoahGC"
before:   65.86s user 5.05s system 156% cpu 45.215 total
after:   83.25s user 4.82s system 469% cpu 18.741 total
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.

Looks nice. A few stylistic comments:

System.out.println("All tests passed");
} else {
throw new RuntimeException("Some tests failed");
}
}
}

Copy link
Member

Choose a reason for hiding this comment

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

Do we need a newline here?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1, would be nice if this extra newline is removed.

@shipilev
Copy link
Member

/reviewers 2

@openjdk
Copy link

openjdk bot commented Sep 21, 2023

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

8316415: Parallelize sun/security/rsa/SignedObjectChain.java subtests

Reviewed-by: shade, rhalade, valeriep

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

  • eeb63cd: 8316361: C2: assert(!failure) failed: Missed optimization opportunity in PhaseIterGVN with -XX:VerifyIterativeGVN=10
  • 6948942: 8317327: Remove JT_JAVA dead code in jib-profiles.js
  • 795e5dc: 8315503: G1: Code root scan causes long GC pauses due to imbalanced iteration
  • 207819a: 8315604: IGV: dump and visualize node bottom and phase types
  • 8fcf70e: 5066247: Refine the spec of equals() and hashCode() for j.text.Format classes
  • 93f662f: 8317335: Build on windows fails after 8316645
  • b8fa6c2: 8316186: RISC-V: Remove PlatformCmpxchg<4>
  • fb055e7: 8316645: RISC-V: Remove dependency on libatomic by adding cmpxchg 1b
  • 009f5e1: 8317141: Remove unused validIndex method from URLClassPath$JarLoader
  • 47569a2: 8295919: java.security.MessageDigest.isEqual does not adhere to @implNote
  • ... and 190 more: https://git.openjdk.org/jdk/compare/3828dc913a3ea28d622b69bd07f26949128eb5f7...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 (@shipilev, @rhalade, @valeriepeng) 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 21, 2023
@openjdk
Copy link

openjdk bot commented Sep 21, 2023

@shipilev
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Sep 21, 2023
@shipilev
Copy link
Member

Shows a very good improvement here as well:

% time CONF=linux-x86_64-server-fastdebug make test TEST=sun/security/rsa/SignedObjectChain.java TEST_VM_OPTS="-XX:TieredStopAtLevel=1"

Baseline:
CONF=linux-x86_64-server-fastdebug make test    333.34s user 5.04s system 111% cpu 5:02.33 total
CONF=linux-x86_64-server-fastdebug make test    292.03s user 5.27s system 114% cpu 4:20.71 total
CONF=linux-x86_64-server-fastdebug make test    330.51s user 5.23s system 111% cpu 5:00.18 total

Patched:
CONF=linux-x86_64-server-fastdebug make test    309.72s user 4.92s system 505% cpu 1:02.25 total
CONF=linux-x86_64-server-fastdebug make test    275.63s user 5.02s system 540% cpu   51.82 total
CONF=linux-x86_64-server-fastdebug make test    299.18s user 5.06s system 546% cpu   55.64 total

@shipilev
Copy link
Member

@valeriepeng, would you like to take a look?

@shipilev
Copy link
Member

Or maybe @rhalade?

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 29, 2023
@valeriepeng
Copy link
Contributor

I will take a look, sorry has been busy the past few days...

@valeriepeng
Copy link
Contributor

Looks good to me as well. Would be nice to apply the stylistic changes suggested by @shipilev before integrating. Thanks!

msobiers and others added 2 commits October 2, 2023 10:38
Copy link
Contributor Author

@msobiers msobiers left a comment

Choose a reason for hiding this comment

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

Removing unnecessary line

@msobiers
Copy link
Contributor Author

msobiers commented Oct 2, 2023

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Oct 2, 2023
@openjdk
Copy link

openjdk bot commented Oct 2, 2023

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

@shipilev
Copy link
Member

shipilev commented Oct 2, 2023

/sponsor

@openjdk
Copy link

openjdk bot commented Oct 2, 2023

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

  • eeb63cd: 8316361: C2: assert(!failure) failed: Missed optimization opportunity in PhaseIterGVN with -XX:VerifyIterativeGVN=10
  • 6948942: 8317327: Remove JT_JAVA dead code in jib-profiles.js
  • 795e5dc: 8315503: G1: Code root scan causes long GC pauses due to imbalanced iteration
  • 207819a: 8315604: IGV: dump and visualize node bottom and phase types
  • 8fcf70e: 5066247: Refine the spec of equals() and hashCode() for j.text.Format classes
  • 93f662f: 8317335: Build on windows fails after 8316645
  • b8fa6c2: 8316186: RISC-V: Remove PlatformCmpxchg<4>
  • fb055e7: 8316645: RISC-V: Remove dependency on libatomic by adding cmpxchg 1b
  • 009f5e1: 8317141: Remove unused validIndex method from URLClassPath$JarLoader
  • 47569a2: 8295919: java.security.MessageDigest.isEqual does not adhere to @implNote
  • ... and 190 more: https://git.openjdk.org/jdk/compare/3828dc913a3ea28d622b69bd07f26949128eb5f7...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 2, 2023

@shipilev @msobiers Pushed as commit 5984792.

💡 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
integrated Pull request has been integrated security security-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

4 participants