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

Fix the references in continunation java stacks for scavenger backout #19559

Merged
merged 1 commit into from
May 29, 2024

Conversation

LinHu2016
Copy link
Contributor

In #19388, we are fixing up stack references of unmounted continuation for scavenge backout during reverseForwardedObject(), but the fixup would depend on the related resverseForwardedPointer installed, so the scan for fix-up need to be done after all resverseForwardedPointer are installed, otherwise some fix-up would miss.

Using backoutContinuationObjects() to scan/fixup all of continuation stack references in evacuate region.

@amicic amicic added comp:gc project:loom Used to track Project Loom related work labels May 28, 2024
GC_HeapRegionIteratorStandard regionIterator(regionManager);

while (NULL != (region = regionIterator.nextRegion())) {
if ((MEMORY_TYPE_NEW == (region->getTypeFlags() & MEMORY_TYPE_NEW)) && _scavenger->isObjectInEvacuateMemory((omrobjectptr_t )region->getLowAddress())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

NEW check is probably redundant

omrobjectptr_t next = _extensions->accessBarrier->getContinuationLink(object);
MM_ForwardedHeader forwardHeader(object, compressed);
Assert_MM_false(forwardHeader.isForwardedPointer());
Assert_MM_false(forwardHeader.isReverseForwardedPointer());
Copy link
Contributor

Choose a reason for hiding this comment

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

isForwardedPointer assert is reasonable, but isReverseForwardedPointer is probably overkill (knowing that we are doing this pass only in Evacuate and that reverseFP cannot be there)
we are asserting that forwarded pointers have been restored (that restoration pass has completed before)

{
#if defined(OMR_GC_CONCURRENT_SCAVENGER)
if (_extensions->isConcurrentScavengerEnabled()) {
/* nothing need to do for concurrent scavenger case */
Copy link
Contributor

Choose a reason for hiding this comment

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

rather than just stating the obvious, try to explain why.
something like: for CS no need to backout stack references, since they will be fixed up to point to the new version of the object (if not already do so), later during marking when continuation objects are found live

In eclipse-openj9#19388, we are fixing up
stack references of unmounted continuation for scavenge backout during
reverseForwardedObject(), but the fixup would depend on the related
resverseForwardedPointer installed, so the scan for fix-up need to be
done after all resverseForwardedPointer are installed, otherwise some
fix-up would miss.

Using backoutContinuationObjects() to scan/fixup all of continuation
stack references in evacuate region.

Signed-off-by: hulin <linhu@ca.ibm.com>
@amicic
Copy link
Contributor

amicic commented May 28, 2024

jenkins test sanity win,aix jdk21

@amicic amicic merged commit 819ff8b into eclipse-openj9:master May 29, 2024
7 checks passed
@pshipton
Copy link
Member

Seems like a change we should be adding to the 0.46 release?

@LinHu2016
Copy link
Contributor Author

the PR for cherrypicking to 0.46 release
#19574

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:gc project:loom Used to track Project Loom related work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants