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

Commits on Dec 14, 2023

  1. Prevent requesting exclusive, if already acquired

    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>
    Aleksandar Micic authored and Aleksandar Micic committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    76062ef View commit details
    Browse the repository at this point in the history