RFR: 8369467: Rdtsc: Remove experimental support for non invariant tsc [v2]

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


On Thu, 9 Oct 2025 11:40:02 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

>> 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

Pushed a patch which removes the ability for `UseFastUnorderedTimeStamps` to override disabling rdtsc when it is not invariant.

However there is now a small mismatch with what the flag says it does vs what it can do. 
The only thing it now can do is disable rdtsc on systems with invariant tsc. It might be that we should remove this flag and introduce a new one where the behaviour of disabling rdtsc is more obvious. 

But not sure what we would prefer to do here w.r.t. the advance VM option `UseFastUnorderedTimeStamps`.

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

PR Comment: https://git.openjdk.org/jdk/pull/27713#issuecomment-3385481907


More information about the hotspot-dev mailing list