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

Thomas Schatzl tschatzl at openjdk.org
Fri Jun 27 09:48:07 UTC 2025


On Thu, 26 Jun 2025 19:34:58 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Thomas Schatzl has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   * more kbarrett review
>
> src/hotspot/share/gc/g1/g1ConcurrentMark.cpp line 2283:
> 
>> 2281:   // (5) We check whether we've reached our time quota. If we have,
>> 2282:   // then we abort.
>> 2283:   double elapsed_time_ms = (double)(curr_time_ns - _start_cpu_time_ns) / NANOSECS_PER_MILLISEC;
> 
> Maybe there should be a helper for this calculation, since there are several occurrences of it?

I considered a helper, but could not find a good name. 

There is `nanos_to_millis()`, but it truncates the result (using integer division).

Do you have a suggestion?

> src/hotspot/share/gc/g1/g1RemSetSummary.cpp line 47:
> 
>> 45:     virtual void do_thread(Thread* t) {
>> 46:       G1ConcurrentRefineThread* crt = static_cast<G1ConcurrentRefineThread*>(t);
>> 47:       _summary->set_rs_thread_vtime(_counter, crt->cpu_time_s());
> 
> There's still a bunch of "vtime" nomenclature in this file. Is the plan to clean that up later?

I originally wanted to clean this up later, but added it now as I changed the internal time base to ns too. There is some additional cleanup about the `HRRSIter` class, I filed an issue for that.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26001#discussion_r2171420856
PR Review Comment: https://git.openjdk.org/jdk/pull/26001#discussion_r2171422301


More information about the hotspot-gc-dev mailing list