RFR: 8273239: Standardize Ticks APIs return type [v2]

Paul Hohensee phh at openjdk.java.net
Tue Sep 14 13:21:09 UTC 2021


On Tue, 7 Sep 2021 17:27:00 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Simple change on return types of Ticks API.
>> 
>> The call of `milliseconds()` in `spinYield.cpp` seems a bug to me, because the unit in the message is `usecs`. Therefore, I changed it to `microseconds()`.
>> 
>> Test: tier1
>
> Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   template

Looking at the Rdtsc implementation, It could cause precision loss in any case because Rdtsc::frequency() is the cpu clock rate, which is typically larger than NANOSECS_PER_SEC. One would have to go to picoseconds as the base rate to fix that, but picosecond precision in 64 bits (a uint64_t) is roughly the same as nanosecond precision in 53 bits (a double), so we wouldn't gain anything by doing that. Double it is.

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

Marked as reviewed by phh (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/5332


More information about the hotspot-dev mailing list