Skip to content

(0.46) Skip jitCodeCache reclamation for scavenge backout case #19664

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

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

pshipton
Copy link
Member

jitCodeCache reclamation would be triggered by GC cycle end event,
For scavenge backout case, at the end of cycle, heap would be rolled
back to before scavenge cycle start, and another global GC would start
right after the end of backout scavenge, so there is no need to do
jitCodeCache reclamation at the end of backout scavenge.
also from Java21 the partial reclamation(related with virtualThread)
processing has been split to move to clearable phase of GC in order to improve the processing performance
(PR:#17527), but for scavenge backout case, the backout only could happen before the first part of reclamation processing(the processing would never get a chance to run for the case), without the first part reclamation processing, the second part of reclamation processing, which triggered by GC cycle end, would be possible to reclaim the "live" stack jit frames, then cause the crash. so we need to skip jitCodeCache reclamation for scavenge backout case.

  • pass unsuccessful state via the cycleType of Cycle End event to the jitcodecache relamation hook for backout case.
  • check if unsuccessful state is set in the hook, if it is true, skip jitcodecache relamation processing(second part).

Cherry pick #19587
Depends on eclipse-openj9/openj9-omr#208

 jitCodeCache reclamation would be triggered by GC cycle end event,
 For scavenge backout case, at the end of cycle, heap would be rolled
 back to before scavenge cycle start, and another global GC would start
 right after the end of backout scavenge, so there is no need to do
 jitCodeCache reclamation at the end of backout scavenge.
 also from Java21 the partial reclamation(related with virtualThread)
processing has been split to move to clearable phase of GC in order to
improve the processing performance
(PR:eclipse-openj9#17527), but for
scavenge backout case, the backout only could happen before the first
part of reclamation processing(the processing would never get a chance
to run for the case), without the first part  reclamation processing,
the second part of reclamation processing, which triggered by GC cycle
end, would be possible to reclaim the "live" stack jit frames, then
cause the crash. so we need to skip jitCodeCache reclamation for
scavenge backout case.

 - pass unsuccessful state via the cycleType of Cycle End event to the
 jitcodecache relamation hook for backout case.
 - check if unsuccessful state is set in the hook, if it is true, skip
  jitcodecache relamation processing(second part).

Signed-off-by: hulin <[email protected]>
@pshipton pshipton requested a review from amicic June 10, 2024 16:32
@pshipton pshipton requested a review from dsouzai as a code owner June 10, 2024 16:32
@amicic amicic merged commit ba26301 into eclipse-openj9:v0.46.0-release Jun 10, 2024
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.

3 participants