Skip to content

Look into the possibility of removing the crst for AssemblyIterator during GC #2341

Closed
@mjsabby

Description

@mjsabby

DevDiv workitem: https://devdiv.visualstudio.com/defaultcollection/DevDiv/_workitems/edit/125447/

From @jkotas in an internal email thread:

Right now, the list is manipulated in preemptive mode (AppDomain::AddAssembly / RemoveAssembly has MODE_ANY contract), so I do not think we can just remove this lock during GC. However, if we can change the code to always manipulate the list in cooperative mode, the lock can be removed during GC.

We should opened a bug on it, so that somebody looks into it in more details.

-Jan

Callstack causing the performance problem

    |+ clr!CrstBase::Enter
    | + clr!CrstBase::CrstHolder::CrstHolder
    | |+ clr!AppDomain::AssemblyIterator::Next
    | ||+ clr!AppDomain::EnumStaticGCRefs
    | || + clr!SystemDomain::EnumAllStaticGCRefs
    | ||  + clr!CNameSpace::GcScanRoots
    | ||   + clr!SVR::gc_heap::background_mark_phase
    | ||   |+ clr!SVR::gc_heap::gc1
    | ||   | + clr!SVR::gc_heap::bgc_thread_function
    | ||   |  + clr!Thread::intermediateThreadProc
    | ||   |   + kernel32!BaseThreadInitThunk
    | ||   |    + ntdll!RtlUserThreadStart

cc @Maoni0 @PeterSolMS

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions