Skip to content

Add missing exclusive access for thread iteration - #24258

Merged
gacholio merged 1 commit into
eclipse-openj9:masterfrom
tajila:jfr1
Jul 5, 2026
Merged

Add missing exclusive access for thread iteration#24258
gacholio merged 1 commit into
eclipse-openj9:masterfrom
tajila:jfr1

Conversation

@tajila

@tajila tajila commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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.

@tajila

tajila commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

FYI @thallium This fixes the issues of missing data in the JFR file. It may also fix the crash in your PR.

@tajila
tajila force-pushed the jfr1 branch 2 times, most recently from 2040cc2 to 071a18b Compare June 29, 2026 15:21
@tajila

tajila commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test sanity.functional alinux64 jdk17,jdk21

@tajila

tajila commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test sanity.functional alinux64 jdk17,jdk21

@gacholio

Copy link
Copy Markdown
Contributor
FAILED test targets:
19:49:34  	cmdLineTester_jfr_0

@tajila

tajila commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

test are just running slower, ive made them a bit shorter

@tajila

tajila commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test sanity.functional alinux64 jdk17,jdk21

@tajila

tajila commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test sanity.functional alinux64 jdk17,jdk21

@gacholio

Copy link
Copy Markdown
Contributor

Just to be clear, the exclusive protects the thread iteration and also the updating of these fields:

https://github.com/eclipse-openj9/openj9/pull/24258/changes#diff-cde00d8271948571bc335fbc3d6cef3b46a7020630043cfd31ce6d774a3d6a59R1046-R1049

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.

@tajila

tajila commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

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.

@tajila
tajila force-pushed the jfr1 branch 2 times, most recently from 525dcc4 to 2b9845c Compare July 3, 2026 16:32
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>
@tajila

tajila commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test sanity.functional alinux64 jdk17,jdk21

@tajila
tajila marked this pull request as ready for review July 4, 2026 01:47
@tajila

tajila commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

@gacholio this is ready to go

@gacholio
gacholio merged commit 6782655 into eclipse-openj9:master Jul 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants