On Thu, 30 Nov 2023 09:30:14 GMT, Stefan Johansson <sjoha...@openjdk.org> wrote:
>> Both `publish_gc_total_cpu_time` and `~ThreadTotalCPUTimeClosure` are called >> by the vm-thread inside a safepoint, so there shouldn't be any other threads >> running simultaneously, I believe. > > Me and Albert just spoke and we do see the problem that two concurrent > threads could be executing the closure at the same time. So if having a total > counter we need to sync the updates. But when talking we started to question > how useful it is to have the gc_total counter. It is just an aggregate of the > other gc-counters, but it is out of sync between safepoints. So you will > always get a more accurate value by looking at the individual gc-counters. > > We came to the conclusion that it would probably be easier to drop `gc_total` > right now, rather than trying to keep it in sync for all updates to the > individual counters. Because having them out of sync doesn't feel like a > great option. > > Are we missing anything or do you agree? @simonis was the original suggester of this counter, so I will defer to his expertise. I do agree that dropping the counter would simplify things, but it also might not hurt to just leave it in. I'm okay with either option! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15082#discussion_r1411270546