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

Albert Mingkun Yang ayang at openjdk.org
Wed Nov 29 15:27:52 UTC 2023


On Wed, 29 Nov 2023 08:24:22 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> Jonathan Joo has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Fix namespace issues (2)
>>    
>>    Co-authored-by: Stefan Johansson <54407259+kstefanj at users.noreply.github.com>
>>  - Fix namespace issues
>>    
>>    Co-authored-by: Stefan Johansson <54407259+kstefanj at users.noreply.github.com>
>
> src/hotspot/share/runtime/cpuTimeCounters.cpp line 91:
> 
>> 89:   } while (old_value != fetched_value);
>> 90:   get_counter(CPUTimeGroups::CPUTimeType::gc_total)->inc(fetched_value);
>> 91: }
> 
> Why do we have to do this publish dance? Couldn't the closure that update the diff instead just update the counter? From what I can tell we never have multiple closures active at the same time so should be no race there?

This two-step update does seem unnecessary, IMO.

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

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


More information about the serviceability-dev mailing list