RFR: 8352251: Implement JEP 518: JFR Cooperative Sampling [v23]
Markus Grönlund
mgronlun at openjdk.org
Tue May 20 16:35:06 UTC 2025
On Tue, 20 May 2025 16:22:58 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:
>>> That is very good spotted indeed. There is a race here if the top frame is invalidated and we just go with the sender (it would describe the carrier frames for the vthread, something I had some problems with in the very beginning).
>>>
>>> My neurons about Continuations and "rbp in continuations" are unfortunately way off in DRAM, on some remote NUMA node to boot.
>>>
>>> Can you help me think out how to handle the Continuation specific things in parsing here?
>>>
>> Ok, no need to bring it to cache since this has been fixed (modulo the extra check discussed) with the new approach. : )
>
>> > > Where do you suggest to place it best?
>> >
>> >
>> > Should be in `FreezeBase::unwind_frames()`. That's where we change the anchor to the ContinuationEntry.
>>
>> Fixed. Thanks.
>>
> Thanks. Ideally we would avoid the extra overhead for the freeze fast path. We could always force the slow path when creating the sample request by setting _cont_fastpath_thread_state, which currently is only used for JVMTI to force the slow path on interpreted only mode. But I could take care of that as a follow up if you want. Can we inline the has_sample_request() check to avoid the call on the common case?
> That is very good spotted indeed. There is a race here if the top frame is invalidated and we just go with the sender (it would describe the carrier frames for the vthread, something I had some problems with in the very beginning).
>
> My neurons about Continuations and "rbp in continuations" are unfortunately way off in DRAM, on some remote NUMA node to boot.
>
> Can you help me think out how to handle the Continuation specific things in parsing here?
We reasoned out a way to accomplish this. But not only that, there is actually a way to write ALL sample requests, by selecting the thread id as a function of the sampled frame. This means a mounted vthread will be able to write a sample and attribute it correctly to its carrier thread.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24296#discussion_r2098410555
More information about the hotspot-jfr-dev
mailing list