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

(0.42) Prevent requesting exclusive, if already acquired #18629

Merged

Conversation

amicic
Copy link
Contributor

@amicic amicic commented Dec 14, 2023

Propagation of #18606

This is to prevent requestExclusiveVMAccessMetronomeTemp (used from
alarm thread) from blocking if exclusive VM access is already requested
prior to calling a system GC. This prevention
(synchronizeRequestsFromExternalThread) already works for plain
exclusive, but not if safePoint is acquired (since it does not set
exclusiveAccessState to J9_XACCESS_EXCLUSIVE).

While proper solution might be around fixing
synchronizeRequestsFromExternalThread to account for safePointState and
how exclusiveAccessState is changed during safePoint acquire, it would
require more time to get it right.

This solution is a workaround where there is an additional flag that is
to be set by after safePoint is acquired and before GC is invoked. That
flag will be checked by requestExclusiveVMAccessMetronomeTemp before
actually proceeding with the request.

There should be no timing hole where
requestExclusiveVMAccessMetronomeTemp is called after safe point is
acquired and the flag is set, since
requestExclusiveVMAccessMetronomeTemp itself cannot be invoked if GC is
not in progress (and indeed system GC has not been triggered yet).

Signed-off-by: Aleksandar Micic <Aleksandar_Micic@ca.ibm.com>
@amicic amicic changed the title Prevent requesting exclusive, if already acquired (0.42) Prevent requesting exclusive, if already acquired Dec 14, 2023
@pshipton pshipton merged commit 4fb12e9 into eclipse-openj9:v0.42.0-release Dec 14, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants