RFR: 8369467: Rdtsc: Avoid initialize_elapsed_counter when UseFastUnorderedTimeStamps will be disabled [v2]

Axel Boldt-Christmas aboldtch at openjdk.org
Thu Oct 9 11:40:02 UTC 2025


> The feature to use rdtsc when it is not invariant requires us to set `UseFastUnorderedTimeStamps`. However, the current implementation always does `do_time_measurements` first, which adds an accumulative 3 ms of sleeps during bootstrapping. While most modern hardware supports invariant tsc, we have observed that many virtualized environments disable this even if it is running on supported hardware. Which means that doing this adds to our startup time even if the feature is never used on many common deployments.
> 
> I suggest we do some checking before deciding to call `initialize_elapsed_counter` and avoid it if we know we will not use rdtsc regardless of the outcome.

Axel Boldt-Christmas has updated the pull request incrementally with one additional commit since the last revision:

  Rdtsc: Remove experimental support for non invariant tsc

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/27713/files
  - new: https://git.openjdk.org/jdk/pull/27713/files/64299f8c..203e865e

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=27713&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27713&range=00-01

  Stats: 114 lines in 2 files changed: 3 ins; 96 del; 15 mod
  Patch: https://git.openjdk.org/jdk/pull/27713.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27713/head:pull/27713

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


More information about the hotspot-dev mailing list