RFR: 8274051: Remove supports_vtime()/elapsedVTime() [v2]

Thomas Schatzl tschatzl at openjdk.org
Fri Jun 27 09:39:33 UTC 2025


> 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

Thomas Schatzl has updated the pull request incrementally with one additional commit since the last revision:

  * kbarrett review

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/26001/files
  - new: https://git.openjdk.org/jdk/pull/26001/files/b615ddbd..9662ba1e

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=26001&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26001&range=00-01

  Stats: 39 lines in 6 files changed: 0 ins; 1 del; 38 mod
  Patch: https://git.openjdk.org/jdk/pull/26001.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26001/head:pull/26001

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


More information about the hotspot-gc-dev mailing list