diff options
author | Koundinya Veluri <kouvel@users.noreply.github.com> | 2018-07-16 22:04:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-16 22:04:07 -0700 |
commit | 6b403ca4422f2bf3df9d25a32790cc4c0d4b6ee4 (patch) | |
tree | 74e1aecfcbd2054d410555217deae83b0d901a7e /src/utilcode | |
parent | 2a4db3b265eccb9d56e3706d260237b3687da9ca (diff) | |
download | coreclr-6b403ca4422f2bf3df9d25a32790cc4c0d4b6ee4.tar.gz coreclr-6b403ca4422f2bf3df9d25a32790cc4c0d4b6ee4.tar.bz2 coreclr-6b403ca4422f2bf3df9d25a32790cc4c0d4b6ee4.zip |
Apply tiering's call counting delay more broadly (#18610)
Apply tiering's call counting delay more broadly
Issues
- When some time passes between process startup and first significant use of the app, startup perf with tiering can be slower because the call counting delay is no longer in effect
- This is especially true when the process is affinitized to one cpu
Fixes
- Initiate and prolong the call counting delay upon tier 0 activity (jitting or r2r code lookup for a new method)
- Stop call counting for a called method when the delay is in effect
- Stop (and don't start) tier 1 jitting when the delay is in effect
- After the delay resume call counting and tier 1 jitting
- If the process is affinitized to one cpu at process startup, multiply the delay by 10
No change in benchmarks.
Diffstat (limited to 'src/utilcode')
-rw-r--r-- | src/utilcode/util.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/utilcode/util.cpp b/src/utilcode/util.cpp index 97b90ed06f..e95f3f4a08 100644 --- a/src/utilcode/util.cpp +++ b/src/utilcode/util.cpp @@ -852,13 +852,14 @@ BYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr, } #endif -/*static*/ BOOL CPUGroupInfo::m_enableGCCPUGroups = FALSE; -/*static*/ BOOL CPUGroupInfo::m_threadUseAllCpuGroups = FALSE; -/*static*/ WORD CPUGroupInfo::m_nGroups = 0; -/*static*/ WORD CPUGroupInfo::m_nProcessors = 0; -/*static*/ WORD CPUGroupInfo::m_initialGroup = 0; +/*static*/ BOOL CPUGroupInfo::m_enableGCCPUGroups = FALSE; +/*static*/ BOOL CPUGroupInfo::m_threadUseAllCpuGroups = FALSE; +/*static*/ WORD CPUGroupInfo::m_nGroups = 0; +/*static*/ WORD CPUGroupInfo::m_nProcessors = 0; +/*static*/ WORD CPUGroupInfo::m_initialGroup = 0; /*static*/ CPU_Group_Info *CPUGroupInfo::m_CPUGroupInfoArray = NULL; -/*static*/ LONG CPUGroupInfo::m_initialization = 0; +/*static*/ LONG CPUGroupInfo::m_initialization = 0; +/*static*/ bool CPUGroupInfo::s_hadSingleProcessorAtStartup = false; // Check and setup function pointers for >64 LP Support /*static*/ BOOL CPUGroupInfo::InitCPUGroupInfoAPI() @@ -1066,6 +1067,18 @@ DWORD LCM(DWORD u, DWORD v) m_enableGCCPUGroups = enableGCCPUGroups && hasMultipleGroups; m_threadUseAllCpuGroups = threadUseAllCpuGroups && hasMultipleGroups; #endif // _TARGET_AMD64_ || _TARGET_ARM64_ + + // Determine if the process is affinitized to a single processor (or if the system has a single processor) + DWORD_PTR processAffinityMask, systemAffinityMask; + if (GetProcessAffinityMask(GetCurrentProcess(), &processAffinityMask, &systemAffinityMask)) + { + processAffinityMask &= systemAffinityMask; + if (processAffinityMask != 0 && // only one CPU group is involved + (processAffinityMask & (processAffinityMask - 1)) == 0) // only one bit is set + { + s_hadSingleProcessorAtStartup = true; + } + } } /*static*/ BOOL CPUGroupInfo::IsInitialized() |