RFR: 8262094: Handshake timeout scaled wrong
Robbin Ehn
rehn at openjdk.java.net
Mon Feb 22 11:04:39 UTC 2021
On Mon, 22 Feb 2021 09:01:16 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
> Why are we using os::javaTimeNanos instead os::elapsed_counter()? I think we've tried to limit the usage of to places that explicitly interact with the Java side. For example, the reference processor uses os::javaTimeNanos because it interacts with java.lang.ref.SoftReference.clock. Most other places in the JVM uses os::elapsed_counter().
Both uses a 'java type', jlong.
For logging and logic for yielding we want a humanly understand unit that is absolute.
Since things goes pretty fast nowadays nanseconds seems reasonable.
Instead of to converting the elapsed_counter to nanos, it's much simpler to just get the nanos.
But yes it would preferably with a os::timeNanos().
-------------
PR: https://git.openjdk.java.net/jdk/pull/2666
More information about the hotspot-runtime-dev
mailing list