Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read-acquire Class Unload Mutex for compilation before checkpoint (0.38) #17150

Merged
merged 1 commit into from Apr 11, 2023

Conversation

dsouzai
Copy link
Contributor

@dsouzai dsouzai commented Apr 11, 2023

Cherry-pick of #17136 and #17143 (squashed into one commit)

The following deadlock is possible:

1. Comp thread read-enters class unload mutex
2. Checkpointing thread acquires comp monitor
3. Comp thread blocks trying to acquire comp monitor
4. Checkpointing thread blocks trying to write-enter class unload mutex

The reason the Checkpointing thread acquires the class unload mutex is
to prevent class unloading while it collects methods. However, a
read-acquire is sufficient for this task.

Therefore, having the Checkpointing thread do a read-acquire will
prevent the deadlock since it will not block waiting to enter.

Signed-off-by: Irwin D'Souza <dsouzai.gh@gmail.com>
@dsouzai dsouzai added comp:jit criu Used to track CRIU snapshot related work labels Apr 11, 2023
@dsouzai
Copy link
Contributor Author

dsouzai commented Apr 11, 2023

@mpirvu could you review/merge?

Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mpirvu mpirvu self-assigned this Apr 11, 2023
@mpirvu mpirvu merged commit 3a78f1d into eclipse-openj9:v0.38.0-release Apr 11, 2023
@dsouzai dsouzai deleted the fixCriuDeadlock_0.38 branch April 3, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:jit criu Used to track CRIU snapshot related work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants