diff options
author | Tom Deseyn <tom.deseyn@gmail.com> | 2018-01-29 21:11:10 +0100 |
---|---|---|
committer | Maoni Stephens <Maoni0@users.noreply.github.com> | 2018-01-29 12:11:10 -0800 |
commit | cb73944d6d159bd02adc29f0588b97f0f76da1a1 (patch) | |
tree | 9c4f406b9d5bf886c64fceb19213c25176e988cd /src/vm/amd64 | |
parent | 850a5bea5b8c317250f7f7ef85152d92468382b0 (diff) | |
download | coreclr-cb73944d6d159bd02adc29f0588b97f0f76da1a1.tar.gz coreclr-cb73944d6d159bd02adc29f0588b97f0f76da1a1.tar.bz2 coreclr-cb73944d6d159bd02adc29f0588b97f0f76da1a1.zip |
Perform PhysicalMemoryLimit check for workstation GC, refactor GetLargestOnDieCacheSize into GetCacheSizePerLogicalCpu (#15975)
* refactor: combine GetLargestOnDieCacheSize and GetLogicalCpuCount in GetCacheSizePerLogicalCpu
* Perform PhysicalMemoryLimit check also for workstation GC
Diffstat (limited to 'src/vm/amd64')
-rw-r--r-- | src/vm/amd64/cgenamd64.cpp | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/src/vm/amd64/cgenamd64.cpp b/src/vm/amd64/cgenamd64.cpp index 6075134943..56e3bfa738 100644 --- a/src/vm/amd64/cgenamd64.cpp +++ b/src/vm/amd64/cgenamd64.cpp @@ -458,89 +458,6 @@ BOOL GetAnyThunkTarget (CONTEXT *pctx, TADDR *pTarget, TADDR *pTargetMethodDesc) // determine the number of logical cpus, or the machine is not populated uniformly with the same // type of processors, this function returns 1. -extern "C" DWORD __stdcall getcpuid(DWORD arg, unsigned char result[16]); - -// fix this if/when AMD does multicore or SMT -DWORD GetLogicalCpuCount() -{ - // No CONTRACT possible because GetLogicalCpuCount uses SEH - - STATIC_CONTRACT_THROWS; - STATIC_CONTRACT_GC_NOTRIGGER; - - static DWORD val = 0; - - // cache value for later re-use - if (val) - { - return val; - } - - struct Param : DefaultCatchFilterParam - { - DWORD retVal; - } param; - param.pv = COMPLUS_EXCEPTION_EXECUTE_HANDLER; - param.retVal = 1; - - PAL_TRY(Param *, pParam, ¶m) - { - - unsigned char buffer[16]; - DWORD maxCpuId = getcpuid(0, buffer); - DWORD* dwBuffer = (DWORD*)buffer; - - if (maxCpuId < 1) - goto qExit; - - if (dwBuffer[1] == 'uneG') { - if (dwBuffer[3] == 'Ieni') { - if (dwBuffer[2] == 'letn') { // get SMT/multicore enumeration for Intel EM64T - - - // TODO: Currently GetLogicalCpuCountFromOS() and GetLogicalCpuCountFallback() are broken on - // multi-core processor, but we never call into those two functions since we don't halve the - // gen0size when it's prescott and above processor. We keep the old version here for earlier - // generation system(Northwood based), perf data suggests on those systems, halve gen0 size - // still boost the performance(ex:Biztalk boosts about 17%). So on earlier systems(Northwood) - // based, we still go ahead and halve gen0 size. The logic in GetLogicalCpuCountFromOS() - // and GetLogicalCpuCountFallback() works fine for those earlier generation systems. - // If it's a Prescott and above processor or Multi-core, perf data suggests not to halve gen0 - // size at all gives us overall better performance. - // This is going to be fixed with a new version in orcas time frame. - - if( (maxCpuId > 3) && (maxCpuId < 0x80000000) ) - goto qExit; - - val = GetLogicalCpuCountFromOS(); //try to obtain HT enumeration from OS API - if (val ) - { - pParam->retVal = val; // OS API HT enumeration successful, we are Done - goto qExit; - } - - val = GetLogicalCpuCountFallback(); // Fallback to HT enumeration using CPUID - if( val ) - pParam->retVal = val; - } - } - } -qExit: ; - } - - PAL_EXCEPT_FILTER(DefaultCatchFilter) - { - } - PAL_ENDTRY - - if (val == 0) - { - val = param.retVal; - } - - return param.retVal; -} - void EncodeLoadAndJumpThunk (LPBYTE pBuffer, LPVOID pv, LPVOID pTarget) { CONTRACTL |