RFR: 8344951: Stabilize write barrier micro-benchmarks

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Mon Dec 16 12:52:07 UTC 2024


This changeset makes the `testArrayWriteBarrierFastPath*` micro-benchmarks in `WriteBarrier.java` more robust w.r.t. a few external factors, so that different GC barrier models can be compared more reliably. More specifically, it ensures that:

  - the main loop is never unrolled regardless of the selected GC algorithm,
  - no spilling occurs within the main loop for the final C2 compilation, and
  - the majority of the execution time is spent in the write operation and its associated barrier.

The changes preserve the original G1 barrier test profile, i.e. practically no write crosses heap regions under the default G1 configuration. More sophisticated benchmarks may be added in the future that exercise different G1 barrier levels.

Thanks to Thomas Schatzl for reporting and discussing issues in the micro-benchmarks.

**Testing:** build and run the micro-benchmarks (linux-x64, linux-aarch64, windows-x64, macosx-x64, macosx-aarch64).

-------------

Commit messages:
 - Allow inlining, get rid of reads
 - Add tentative testArrayWriteBarrierFastPathRealLarge version with a single, fixed new value
 - Avoid loads and range checks in null-writing micro-benchmarks
 - Do not inline array micro-benchmarks to avoid spilling in the innermost loop
 - Disable loop unrolling
 - Update copyright

Changes: https://git.openjdk.org/jdk/pull/22763/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22763&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8344951
  Stats: 21 lines in 1 file changed: 5 ins; 10 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/22763.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22763/head:pull/22763

PR: https://git.openjdk.org/jdk/pull/22763


More information about the hotspot-compiler-dev mailing list