RFR: Implement JEP 509: JFR CPU-Time Profiling [v45]

Zhengyu Gu zgu at openjdk.org
Mon May 5 13:29:59 UTC 2025


On Mon, 5 May 2025 13:25:32 GMT, Johannes Bechberger <jbechberger at openjdk.org> wrote:

>>> I see. If it is only used in signal handlers, does it really need to be multi-threaded?
>> 
>> I might be able to simplify the thread-local stacks.
>
> But the global queue of fresh elements (that are then enqueued into the thread-local stacks) needs to signal handler safe (dequeue in multiple signal handlers in multiple thread at the same time) and is pushed to from all threads at their safepoints.

You certainly can use pre-allocated array as allocation pool, with additional `next` field. However, the challenge is how to deal with `ABA` problem (or does it have `ABA` problem?). I am not sure you can use `GlobalCounter` inside signal handlers.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20752#discussion_r2073446877


More information about the hotspot-dev mailing list