RFR: 8315149: Add hsperf counters for CPU time of internal GC threads

David Holmes dholmes at openjdk.org
Wed Aug 30 07:47:17 UTC 2023


On Mon, 31 Jul 2023 01:50:07 GMT, Jonathan Joo <jjoo at openjdk.org> wrote:

> 8315149: Add hsperf counters for CPU time of internal GC threads

This doesn't seem unreasonable, but I do wonder what impact this has on the GC threads to collect this data?

I mentioned it a couple of times, but generally speaking should we only initialize these perf counters when `os::is_thread_cpu_time_supported()`? Or do they need to be readable regardless?

Thanks.

src/hotspot/share/gc/g1/g1ConcurrentMark.cpp line 457:

> 455:   reset_at_marking_complete();
> 456: 
> 457:   if (UsePerfData) {

Should this also check `os::is_thread_cpu_time_supported()`?

src/hotspot/share/gc/g1/g1ConcurrentMark.hpp line 377:

> 375:                            VerifyLocation location);
> 376: 
> 377: 

Spurious blank line added.

src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp line 116:

> 114:   }
> 115: 
> 116:   if (UsePerfData) {

Again should we only initialize if also `os::is_thread_cpu_time_supported()`?

src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp line 166:

> 164:   // The primary thread (_threads[0]) updates the counter for all worker
> 165:   // threads, because:
> 166:   // the primary thread is always waken up first from being blocked on a monitor

s/waken/woken/

src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp line 174:

> 172:          "Must be called from G1ConcurrentRefineThreadControl::_threads[0] to "
> 173:          "avoid races");
> 174:   assert(UsePerfData, "Must be enabled");

`&& os::is_thread_cpu_time_supported()` ?

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

PR Review: https://git.openjdk.org/jdk/pull/15082#pullrequestreview-1602076724
PR Review Comment: https://git.openjdk.org/jdk/pull/15082#discussion_r1309822503
PR Review Comment: https://git.openjdk.org/jdk/pull/15082#discussion_r1309823735
PR Review Comment: https://git.openjdk.org/jdk/pull/15082#discussion_r1309824856
PR Review Comment: https://git.openjdk.org/jdk/pull/15082#discussion_r1309825515
PR Review Comment: https://git.openjdk.org/jdk/pull/15082#discussion_r1309826501


More information about the hotspot-dev mailing list