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

Thomas Schatzl tschatzl at openjdk.org
Mon Jun 30 11:25:45 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

This pull request has now been integrated.

Changeset: 00adbbe5
Author:    Thomas Schatzl <tschatzl at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/00adbbe5538ec5c26dc5bd17ca94cc29db9bc478
Stats:     221 lines in 19 files changed: 29 ins; 99 del; 93 mod

8274051: Remove supports_vtime()/elapsedVTime()

Reviewed-by: kbarrett, iwalulya

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

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


More information about the hotspot-gc-dev mailing list