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

Jonathan Joo jjoo at openjdk.org
Sat Dec 2 01:25:53 UTC 2023


On Fri, 1 Dec 2023 16:19:49 GMT, Volker Simonis <simonis at openjdk.org> wrote:

>> src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp line 905:
>> 
>>> 903:   gc_threads_do(&tttc);
>>> 904: 
>>> 905:   CPUTimeCounters::publish_gc_total_cpu_time();
>> 
>> As I suggested in the other comment, maybe we should not keep the total counter, but if we do we need to make sure the destructor of the closure is run before the call to `publish_gc_total_cpu_time()`. Otherwise we will publish a not yet updated value.
>
> I still think that a total counter is useful and I'd appreciate if you can keep it. To second what @caoman said before, it is GC agnostic, easy to use even for non GC experts and future proof with regards to implementation changes in the GCs. Please keep it.

Put the closure in a scope, I think that should address the concern.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15082#discussion_r1412694432


More information about the hotspot-gc-dev mailing list