RFR: 8348402: PerfDataManager stalls shutdown for 1ms [v4]

Aleksey Shipilev shade at openjdk.org
Fri Jan 31 08:30:29 UTC 2025


> Found this when studying Leyden performance. [JDK-8049304](https://bugs.openjdk.org/browse/JDK-8049304) added 1ms sleep on destruction path to catch up with threads updating the counters. 
> 
> I was not able to confidently prove the deletion race is benign. Even though `sleep` is not really a fix for that race either, I think it is safer to use GlobalCounter to coordinate deletions.
> 
> This improves startup (roundtrip) tests for the expected 1ms:
> 
> 
> $ hyperfine -w 10 -r 100 ...
> 
> # Before
> Benchmark 1: build/linux-x86_64-server-release/images/jdk/bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xmx128m Hello
>   Time (mean ± σ):      20.0 ms ±   0.3 ms    [User: 11.7 ms, System: 16.0 ms]
>   Range (min … max):    19.0 ms …  21.7 ms    1000 runs
> 
> # After
> Benchmark 1: build/linux-x86_64-server-release/images/jdk/bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xmx128m Hello
>   Time (mean ± σ):      19.0 ms ±   0.3 ms    [User: 11.9 ms, System: 15.8 ms]
>   Range (min … max):    18.2 ms …  20.8 ms    1000 runs
> 
> 
> Additional testing:
>  - [x] Linux AArch64 server fastdebug, `all`
>  - [x] Linux x86_64 server fastdebug, `all`

Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:

  David's review: more comments. Also reinstate has_PerfData in unprotected update.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23293/files
  - new: https://git.openjdk.org/jdk/pull/23293/files/c21077c3..0536d1dd

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23293&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23293&range=02-03

  Stats: 17 lines in 2 files changed: 15 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/23293.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23293/head:pull/23293

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


More information about the hotspot-runtime-dev mailing list