RFR: 8352251: Implement JEP 518: JFR Cooperative Sampling [v40]
Markus Grönlund
mgronlun at openjdk.org
Mon May 26 11:00:21 UTC 2025
On Sun, 25 May 2025 20:54: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:
>
> const void* ucontext
> 20826e5
> > > Heads-up: I'm currently testing the PPC64 implementation: [TheRealMDoerr at 9b9f0bf](https://github.com/TheRealMDoerr/jdk/commit/9b9f0bfc06d63110d99ef32553a0dff58cf69136) Note that I'm not using memory barriers. I'm relying on synchronization by the suspend/resume mechanism (as well as the signal handler in case of async profiler). Especially the StoreLoad barrier in the remove_activation code has probably interpreter performance impact.
> >
> >
> > That is great news Martin! Thanks for testing without the barriers. If you are ok without them on PPC, they are most likely not needed on any other platform.
>
> Updated version (`InterpreterRuntime::at_unwind` before `notify_method_exit`): [TheRealMDoerr at 20826e5](https://github.com/TheRealMDoerr/jdk/commit/20826e59b088e42cda50008b4a91b5895e0630b3)
>
> I have seen intermittent failures in TestResidentSetSizeEvent.java:
>
> ```
> java.lang.RuntimeException: Should be non-zero: expected 0 > 0
> at jdk.test.lib.Asserts.fail(Asserts.java:715)
> at jdk.test.lib.Asserts.assertGreaterThan(Asserts.java:403)
> at jdk.jfr.event.runtime.TestResidentSetSizeEvent.verifyExpectedEventTypes(TestResidentSetSizeEvent.java:81)
> at jdk.jfr.event.runtime.TestResidentSetSizeEvent.main(TestResidentSetSizeEvent.java:92)
> at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
> at java.base/java.lang.reflect.Method.invoke(Method.java:565)
> at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
> at java.base/java.lang.Thread.run(Thread.java:1447)
> ```
>
> I don't see any relationship to my changes. Could be related to large pages on the machine.
>
> I'll try more tests.
Are you happy with this version, Martin? https://github.com/TheRealMDoerr/jdk/commit/20826e59b088e42cda50008b4a91b5895e0630b3 ? Or do you want to do some more work?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24296#issuecomment-2909313159
More information about the hotspot-jfr-dev
mailing list