RFR: 8352251: Implement JEP 518: JFR Cooperative Sampling [v25]

Martin Doerr mdoerr at openjdk.org
Mon May 19 14:11:41 UTC 2025


On Mon, 19 May 2025 13:42:47 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:

>> Greetings,
>> 
>> This is the implementation of JEP [JDK-8350338 Cooperative JFR Sampling](https://bugs.openjdk.org/browse/JDK-8350338).
>> 
>> Implementations in this change set are provided and have been tested on the following platforms:
>> 
>> - windows-x64
>> - windows-x64-debug
>> - linux-x64
>> - linux-x64-debug
>> - macosx-x64
>> - macosx-x64-debug
>> - linux-aarch64
>> - linux-aarch64-debug
>> - macosx-aarch64
>> - macosx-aarch64-debug
>> 
>> Testing: tier1-6, jdk_jfr, stress testing.
>> 
>> Platform porters note:
>> Some platform-specific code needs to be provided, mainly in the interpreter. Take a look at the following files for changes:
>> 
>> - src/hotspot/cpu/x86/frame_x86.cpp
>> - src/hotspot/cpu/x86/interp_masm_x86.cpp
>> - src/hotspot/cpu/x86/interp_masm_x86.hpp
>> - src/hotspot/cpu/x86/javaFrameAnchor_x86.hpp
>> - src/hotspot/cpu/x86/macroAssembler_x86.cpp
>> - src/hotspot/cpu/x86/macroAssembler_x86.hpp
>> - src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp
>> - src/hotspot/cpu/x86/templateTable_x86.cpp
>> - src/hotspot/os_cpu/linux_x86/javaThread_linux_x86.hpp
>> 
>> Thanks
>> Markus
>
> Markus Grönlund has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Redesign to avoid the pre-emptive fp move in the interpreter. Replace with a thread-local critical section sampling interrupt mask.

Thank you so much! This is probably very helpful. I had planned to do some experiments on my own, but I was too busy with other issues.
I wonder if we really need memory barriers. The Java threads get suspended before we take a sample, right? So, I think the suspension mechanism should already prevent reordering of memory accesses.
I'll try it on PPC64 as soon as I find some time.

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

PR Comment: https://git.openjdk.org/jdk/pull/24296#issuecomment-2891169235


More information about the hotspot-jfr-dev mailing list