RFR: 8274051: Remove supports_vtime()/elapsedVTime()

David Holmes dholmes at openjdk.org
Fri Jun 27 00:47:38 UTC 2025


On Thu, 26 Jun 2025 12:53:37 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Hi all,
> 
>   please review this change that removes the `*vtime()` methods from G1, replacing them with the appropriate `os::thread_cpu_time()` calls. They completely supersede the former ones.
> 
> Further I made support for `os::thread_cpu_time()` mandatory for G1, it will fail if not available. All platforms implement them, only non-OSX *BSD do not in mainline sources. However in the [official fork](https://github.com/freebsd/openjdk/blob/jdk24u-freebsd/src/hotspot/os/bsd/os_bsd.cpp#L2609) it already does.
> 
> There are upstreaming efforts underway too, so I do not see this as blocker for this behavior. 
> 
> One other change is that the various getters directly use the time returned by the OS function as cpu time, only counting the main work (marking steps, actual refinement) as used cpu time. I do not think this is honest to discount random cpu time spent in other work these threads must do (like getting to and leaving the main work described above).
> 
> There has been some effort to make naming a bit more consistent: cpu times were all named with `_cpu_time` with all non-standard units that unit appended (`_s`for seconds and so on).
> 
> Testing: tier1-3
> 
> Thanks,
>   Thomas

Runtime changes look good - nice to see vtime go away!

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

PR Review: https://git.openjdk.org/jdk/pull/26001#pullrequestreview-2964219658


More information about the hotspot-gc-dev mailing list