Add missing exclusive access for thread iteration - #24258
Conversation
|
FYI @thallium This fixes the issues of missing data in the JFR file. It may also fix the crash in your PR. |
2040cc2 to
071a18b
Compare
|
jenkins test sanity.functional alinux64 jdk17,jdk21 |
|
jenkins test sanity.functional alinux64 jdk17,jdk21 |
|
|
test are just running slower, ive made them a bit shorter |
|
jenkins test sanity.functional alinux64 jdk17,jdk21 |
|
jenkins test sanity.functional alinux64 jdk17,jdk21 |
|
Just to be clear, the exclusive protects the thread iteration and also the updating of these fields: Is it the case that the thread local reader/writer of these fields always has VM access? If not, the exclusive isn't really protecting the update. |
Yes, any interaction with the local/global buffers is always done with at least VMAccess, https://github.com/eclipse-openj9/openj9/blob/master/runtime/vm/jfr.cpp#L414. |
525dcc4 to
2b9845c
Compare
Acquire exclusive when allocating the local JFR buffers so if any new threads are created in this period they must wait for the iteration to complete. After the iteration is complete the thread creation hook is added so new threads will trigger that. Also instead of requesting threadCPU sample on the requestor thread, trigger the async check so threadCPU is captured on all threads. Signed-off-by: Tobi Ajila <atobia@ca.ibm.com>
|
jenkins test sanity.functional alinux64 jdk17,jdk21 |
|
@gacholio this is ready to go |
Acquire exclusive when allocating the local JFR buffers so if any new
threads are created in this period they must wait for the iteration to
complete. After the iteration is complete the thread creation hook is
added so new threads will trigger that.
Also instead of requesting threadCPU sample on the requestor thread,
trigger the async check so threadCPU is captured on all threads.