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

8342958: Use jvmArgs consistently in microbenchmarks #1403

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sendaoYan
Copy link
Member

@sendaoYan sendaoYan commented Feb 13, 2025

Hi all,

  • This is PR contains two backport to jdk21u-dev
  1. Uncleanly backport of JDK-8342958.
  2. Cleanly backport of JDK-8343345.
  • Why do we need these two backport?
  1. Suggests using jvmArgs consistently.
  2. This backport will make several JMH tests run normally after this backport. Before this backport, 'org.openjdk.bench.java.net.NetworkInterfaceLookup.bound' report fails "java.lang.IllegalAccessException: class org.openjdk.bench.java.net.NetworkInterfaceLookup cannot access a member of class java.net.NetworkInterface (in module java.base) with package access", after this backport this JMH test will run passes.

Why this backport can not backport cleanly?

  1. Some JMH tests added after jdk21u, such as test/micro/org/openjdk/bench/java/lang/CallerClassBench.java was added by jdk22.
  2. Some JMH tests removed after jdk21u, such as test/micro/org/openjdk/bench/java/lang/StringTemplateFMT.java wad removed by JDK-8329948
  3. Some JMH tests has diffrent file name ater jdk21u, such as rename from test/micro/org/openjdk/bench/jdk/classfile/GenerateStackMaps.java to test/micro/org/openjdk/bench/jdk/classfile/CodeAttributeTools.java by JDK-8323183

Testing:

  • Run all the touch JMH tests locally.

Test commands:

wget https://patch-diff.githubusercontent.com/raw/openjdk/jdk21u-dev/pull/1403.diff -O JDK-8342958-21u.patch
grep "diff --git" JDK-8342958-21u.patch | awk '{print $3}' | grep "^a/test" | sed "s|^a/test/micro/||" | sed "s|/|.|g" | sed "s|\.java$||" > list.txt
rm -rf build/jmh-result/ ; mkdir -p build/jmh-result/ ; time for test in `cat list.txt` ; do time make test TEST="micro:$test" MICRO="FORK=1;WARMUP_ITER=2" CONF=release &> build/jmh-result/$test.log ; done

Test result:
5 tests fails, the fails unrelated to this PR, I have create a new issue to record this failure. All other tests passes.

jmh-result.zip


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
  • JDK-8343345 needs maintainer approval
  • JDK-8342958 needs maintainer approval

Issues

  • JDK-8342958: Use jvmArgs consistently in microbenchmarks (Enhancement - P4)
  • JDK-8343345: Use -jvmArgsPrepend when running microbenchmarks in RunTests.gmk (Enhancement - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk21u-dev.git pull/1403/head:pull/1403
$ git checkout pull/1403

Update a local copy of the PR:
$ git checkout pull/1403
$ git pull https://git.openjdk.org/jdk21u-dev.git pull/1403/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1403

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk21u-dev/pull/1403.diff

Using Webrev

Link to Webrev Comment

@sendaoYan sendaoYan marked this pull request as draft February 13, 2025 12:07
@bridgekeeper
Copy link

bridgekeeper bot commented Feb 13, 2025

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

@sendaoYan sendaoYan marked this pull request as ready for review February 13, 2025 12:07
@openjdk
Copy link

openjdk bot commented Feb 13, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title Backport 90bd544512de541cd98889bec58f419bc69a723d 8342958: Use jvmArgs consistently in microbenchmarks Feb 13, 2025
@openjdk
Copy link

openjdk bot commented Feb 13, 2025

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport rfr Pull request is ready for review labels Feb 13, 2025
@mlbridge
Copy link

mlbridge bot commented Feb 13, 2025

Webrevs

@sendaoYan
Copy link
Member Author

/issue JDK-8343345

@openjdk
Copy link

openjdk bot commented Feb 13, 2025

@sendaoYan
Adding additional issue to issue list: 8343345: Use -jvmArgsPrepend when running microbenchmarks in RunTests.gmk.

@sendaoYan
Copy link
Member Author

Backport to fix several JMH test bugs and make using jvmArgs consistently. Change has been verified locally, test-fix only, no risk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

1 participant