Skip to content

Don't delay call-counting-installation because of R2R'd code #77635

Open
@EgorBo

Description

@EgorBo

When we re-jit a R2R'd code we hit HandleCallCountingForFirstCall where we set m_tier1CallCountingCandidateMethodRecentlyRecorded = true to delay call-counting installation further, see here.

It seems to me that we should not do that when we already have R2R'd version installed, a proper fix is

if (!ExecutionManager::IsReadyToRunCode(pMethodDesc->GetNativeCode()))
{
    // Delay call counting for currently recoded methods further
    m_tier1CallCountingCandidateMethodRecentlyRecorded = true;
}

However, ExecutionManager::IsReadyToRunCode is likely not cheap due to #8393 issue 😞

The problem, it should help with, is: when we start a large app we constantly compile something and VM simply doesn't have a window to install call counting stubs for methods, even extremely hot ones - they might stuck un-counted in Tier0 for seconds, see #70941 (comment)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions