Skip to content

Conversation

@ericcaspole
Copy link

@ericcaspole ericcaspole commented Mar 12, 2025

Adds new cases based on the existing ones using an extra iteration setup to allocate into young gen, allowing to test old-to-young stores etc, where the existing code is all old-to-old.

Here is a run on a standard OCI A1.160 with JDK 25:

Benchmark                                                                         Mode  Cnt     Score    Error  Units
WriteBarrier.WithDefaultUnrolling.testArrayWriteBarrierFastPathNullLarge          avgt   12  3448.826 ±  1.620  ns/op
WriteBarrier.WithDefaultUnrolling.testArrayWriteBarrierFastPathNullSmall          avgt   12    63.740 ±  0.151  ns/op
WriteBarrier.WithDefaultUnrolling.testArrayWriteBarrierFastPathNullYoungLarge     avgt   12  3448.353 ±  0.860  ns/op
WriteBarrier.WithDefaultUnrolling.testArrayWriteBarrierFastPathNullYoungSmall     avgt   12    63.565 ±  0.132  ns/op
WriteBarrier.WithDefaultUnrolling.testArrayWriteBarrierFastPathOldToYoungLarge    avgt   12  4476.390 ±  0.930  ns/op
WriteBarrier.WithDefaultUnrolling.testArrayWriteBarrierFastPathOldToYoungSmall    avgt   12    73.517 ±  0.082  ns/op
WriteBarrier.WithDefaultUnrolling.testArrayWriteBarrierFastPathRealLarge          avgt   12  3103.911 ±  2.079  ns/op
WriteBarrier.WithDefaultUnrolling.testArrayWriteBarrierFastPathRealSmall          avgt   12    57.549 ±  0.512  ns/op
WriteBarrier.WithDefaultUnrolling.testArrayWriteBarrierFastPathYoungToOldLarge    avgt   12  9587.762 ±  2.044  ns/op
WriteBarrier.WithDefaultUnrolling.testArrayWriteBarrierFastPathYoungToOldSmall    avgt   12   157.244 ±  0.169  ns/op
WriteBarrier.WithDefaultUnrolling.testArrayWriteBarrierFastPathYoungToYoungLarge  avgt   12  3103.191 ±  1.100  ns/op
WriteBarrier.WithDefaultUnrolling.testArrayWriteBarrierFastPathYoungToYoungSmall  avgt   12    57.392 ±  0.624  ns/op
WriteBarrier.WithDefaultUnrolling.testFieldWriteBarrierFastPath                   avgt   12     2.668 ±  0.001  ns/op
WriteBarrier.WithDefaultUnrolling.testFieldWriteBarrierFastPathYoungRef           avgt   12     9.337 ±  0.001  ns/op
WriteBarrier.WithoutUnrolling.testArrayWriteBarrierFastPathNullLarge              avgt   12  3449.234 ±  1.840  ns/op
WriteBarrier.WithoutUnrolling.testArrayWriteBarrierFastPathNullSmall              avgt   12    63.720 ±  0.079  ns/op
WriteBarrier.WithoutUnrolling.testArrayWriteBarrierFastPathNullYoungLarge         avgt   12  3448.055 ±  0.665  ns/op
WriteBarrier.WithoutUnrolling.testArrayWriteBarrierFastPathNullYoungSmall         avgt   12    63.555 ±  0.116  ns/op
WriteBarrier.WithoutUnrolling.testArrayWriteBarrierFastPathOldToYoungLarge        avgt   12  4476.646 ±  1.560  ns/op
WriteBarrier.WithoutUnrolling.testArrayWriteBarrierFastPathOldToYoungSmall        avgt   12    73.525 ±  0.070  ns/op
WriteBarrier.WithoutUnrolling.testArrayWriteBarrierFastPathRealLarge              avgt   12  3104.395 ±  1.537  ns/op
WriteBarrier.WithoutUnrolling.testArrayWriteBarrierFastPathRealSmall              avgt   12    57.766 ±  0.136  ns/op
WriteBarrier.WithoutUnrolling.testArrayWriteBarrierFastPathYoungToOldLarge        avgt   12  9586.585 ±  1.086  ns/op
WriteBarrier.WithoutUnrolling.testArrayWriteBarrierFastPathYoungToOldSmall        avgt   12   157.147 ±  0.128  ns/op
WriteBarrier.WithoutUnrolling.testArrayWriteBarrierFastPathYoungToYoungLarge      avgt   12  3103.531 ±  0.883  ns/op
WriteBarrier.WithoutUnrolling.testArrayWriteBarrierFastPathYoungToYoungSmall      avgt   12    57.669 ±  0.620  ns/op
WriteBarrier.WithoutUnrolling.testFieldWriteBarrierFastPath                       avgt   12     2.668 ±  0.001  ns/op
WriteBarrier.WithoutUnrolling.testFieldWriteBarrierFastPathYoungRef               avgt   12     9.337 ±  0.001  ns/op

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-8346470: Improve WriteBarrier JMH to have old-to-young refs (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 24010

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@ericcaspole
Copy link
Author

/label gc

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 12, 2025

👋 Welcome back ecaspole! 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 Mar 12, 2025

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

8346470: Improve WriteBarrier JMH to have old-to-young refs

Reviewed-by: tschatzl

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:

  • 4e51a8c: 8307513: C2: intrinsify Math.max(long,long) and Math.min(long,long)
  • 7e3bc81: 8351216: ZGC: Store NUMA node count
  • 82eb780: 8351349: GSSUtil.createSubject has outdated access control context and policy related text
  • c3db667: 8351542: LIBMANAGEMENT_OPTIMIZATION remove special optimization settings
  • 375722f: 8351839: RISC-V: Fix base offset calculation introduced in JDK-8347489
  • 4c5956d: 8350866: [x86] Add C1 intrinsics for CRC32-C
  • 9c00331: 8330469: C2: Remove or change "PrintOpto && VerifyLoopOptimizations" as printing code condition
  • c18494d: 8351108: ImageIO.write(..) fails with exception when writing JPEG with IndexColorModel
  • 86860ca: 8346916: [REDO] align_up has potential overflow
  • a33b1f7: 8345298: RISC-V: Add riscv backend for Float16 operations - scalar
  • ... and 40 more: https://git.openjdk.org/jdk/compare/73465b9866da8e97e557d6ad80a95568ada3ee01...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 Mar 12, 2025
@openjdk
Copy link

openjdk bot commented Mar 12, 2025

@ericcaspole
The label gc is not a valid label.
These labels are valid:

  • graal
  • serviceability
  • hotspot
  • hotspot-compiler
  • ide-support
  • kulla
  • i18n
  • shenandoah
  • jdk
  • javadoc
  • security
  • hotspot-runtime
  • jmx
  • build
  • nio
  • client
  • core-libs
  • compiler
  • net
  • hotspot-gc
  • hotspot-jfr

@openjdk
Copy link

openjdk bot commented Mar 12, 2025

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

  • hotspot-compiler

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 hotspot-compiler hotspot-compiler-dev@openjdk.org label Mar 12, 2025
@ericcaspole
Copy link
Author

/label hotspot-gc, hotspot-compiler

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Mar 12, 2025
@openjdk
Copy link

openjdk bot commented Mar 12, 2025

@ericcaspole
The hotspot-gc label was successfully added.
The hotspot-compiler label was already applied.

@mlbridge
Copy link

mlbridge bot commented Mar 12, 2025

Webrevs

Copy link
Contributor

@tschatzl tschatzl left a comment

Choose a reason for hiding this comment

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

Some minor formatting issues...

ericcaspole and others added 2 commits March 13, 2025 11:49
Co-authored-by: Thomas Schatzl <59967451+tschatzl@users.noreply.github.com>
Co-authored-by: Thomas Schatzl <59967451+tschatzl@users.noreply.github.com>
@ericcaspole
Copy link
Author

Updated the code with Thomas' suggestions.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 13, 2025
@ericcaspole
Copy link
Author

/integrate

@openjdk
Copy link

openjdk bot commented Mar 13, 2025

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

  • b50fe9b: 8280818: Expand bug8033699.java to iterate over all LaFs
  • 771e160: 8351323: Parameterize compiler and linker flags for iconv
  • 0ff1c08: 8349984: (jdeps) jdeps can use String.repeat instead of String.replaceAll
  • 37ec796: 8351500: G1: NUMA migrations cause crashes in region allocation
  • 4e51a8c: 8307513: C2: intrinsify Math.max(long,long) and Math.min(long,long)
  • 7e3bc81: 8351216: ZGC: Store NUMA node count
  • 82eb780: 8351349: GSSUtil.createSubject has outdated access control context and policy related text
  • c3db667: 8351542: LIBMANAGEMENT_OPTIMIZATION remove special optimization settings
  • 375722f: 8351839: RISC-V: Fix base offset calculation introduced in JDK-8347489
  • 4c5956d: 8350866: [x86] Add C1 intrinsics for CRC32-C
  • ... and 44 more: https://git.openjdk.org/jdk/compare/73465b9866da8e97e557d6ad80a95568ada3ee01...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 13, 2025

@ericcaspole Pushed as commit 03ef79c.

💡 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

hotspot-compiler hotspot-compiler-dev@openjdk.org hotspot-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

2 participants