Skip to content

8382135: AArch64: HotCodeCollectorMoveFunction.java fails intermittently#31157

Open
chadrako wants to merge 3 commits into
openjdk:masterfrom
chadrako:JDK-8382135-final
Open

8382135: AArch64: HotCodeCollectorMoveFunction.java fails intermittently#31157
chadrako wants to merge 3 commits into
openjdk:masterfrom
chadrako:JDK-8382135-final

Conversation

@chadrako
Copy link
Copy Markdown
Contributor

@chadrako chadrako commented May 13, 2026

JDK-8382135

HotCodeCollectorMoveFunction failed on Nvidia Grace because all samples collected were for System.currentTimeMillis() which lives outside of the code cache. The test expects that at least one sample comes from HotCodeCollectorMoveFunction::func().

The fix for this is to run more code inside of func so that the computation is not dominated by the JNI call.

I also proactively fixed a potential race condition in the sampler where CodeCache::find_blob could return nullptr even though it was guarded by CodeCache::contains(pc). This change is low risk.

Before the patch I was able to get the test failure to reproduce every run. I no longer see the failure after the patch.



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-8382135: AArch64: HotCodeCollectorMoveFunction.java fails intermittently (Bug - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31157

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented May 13, 2026

👋 Welcome back crakoczy! 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
Copy Markdown

openjdk Bot commented May 13, 2026

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

@openjdk openjdk Bot added the hotspot hotspot-dev@openjdk.org label May 13, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 13, 2026

@chadrako 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
Copy link
Copy Markdown

openjdk Bot commented May 13, 2026

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot. This can be overridden with the /reviewers command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label May 13, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented May 13, 2026

Webrevs

@shqking
Copy link
Copy Markdown
Contributor

shqking commented May 14, 2026

Thanks for your fix. Not a code review.
I tested this jtreg case 100 times on the following machines, and all passed now

  • Neoverse-N1
  • Neoverse-V1
  • Nvidia Grace (Neoverse-V2)
  • Graviton 4

while (System.currentTimeMillis() - start < FUNC_RUN_MILLIS) {
for (int i = 0; i < Integer.MAX_VALUE; i++) {
num += i;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A compiler can optimize this loop away. It's the Gauss formula for the sum of the first n
consecutive positive integers.

Maybe

int count = 0, num = 1;
do {
   count++, num *= 69069;
} while (num != 1);
blackhole(count);

or blackhole(i) in the loop, perhaps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot hotspot-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

3 participants