Suspension fixes by PeterSolMS · Pull Request #27578 · dotnet/coreclr (original) (raw)

the other fix that I mentioned that also affects suspension is in revisit_written_page with the same problem in background_mark_simple when we are looking at many pages with no objects that have references in them so we don't have places that allow FGCs. the fix is at the end of this method we add

    if (concurrent_p)
    {
        allow_fgc();
    }

however there is a subtle part of this fix which is if we do allow FGC we will need to get rid of this check in the else if statement:

#ifndef FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP // see comment below
                large_objects_p &&
#endif // !FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP

because we'd hit the situation that's described in that big comment (essentially what it says is just that since now an FGC can happen it can allocate in free objects so we cannot skip). this change actually has no effect as FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP is always defined.