Skip to content

Commit

Permalink
Merge pull request #93582 from carlossanlop/release/7.0-staging
Browse files Browse the repository at this point in the history
[manual] Merge release/7.0-staging into release/7.0
  • Loading branch information
carlossanlop authored Oct 17, 2023
2 parents fb39575 + 72a4b26 commit bad10ca
Show file tree
Hide file tree
Showing 34 changed files with 549 additions and 213 deletions.
2 changes: 2 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
<clear />
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<!-- Begin: Package sources from dotnet-emsdk -->
<add key="darc-pub-dotnet-emsdk-9506882" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-95068821/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-44da825" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-44da825c/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-6f67d4a" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-6f67d4ab/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-emsdk -->
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
<!--
Expand Down
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="7.0.0-rtm.23409.2">
<Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="7.0.0-rtm.23512.1">
<Uri>https://github.com/dotnet/icu</Uri>
<Sha>d7b56b550d4e8319a6851ad2f2544450d521e0ed</Sha>
<Sha>17f1c7cf5247e5ff4d344591ea966334a4f99ff5</Sha>
</Dependency>
<Dependency Name="System.Net.MsQuic.Transport" Version="7.0.0-alpha.1.22459.1">
<Uri>https://github.com/dotnet/msquic</Uri>
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
<MicrosoftNETILLinkTasksVersion>7.0.100-1.23401.1</MicrosoftNETILLinkTasksVersion>
<MicrosoftNETILLinkAnalyzerPackageVersion>$(MicrosoftNETILLinkTasksVersion)</MicrosoftNETILLinkAnalyzerPackageVersion>
<!-- ICU -->
<MicrosoftNETCoreRuntimeICUTransportVersion>7.0.0-rtm.23409.2</MicrosoftNETCoreRuntimeICUTransportVersion>
<MicrosoftNETCoreRuntimeICUTransportVersion>7.0.0-rtm.23512.1</MicrosoftNETCoreRuntimeICUTransportVersion>
<!-- MsQuic -->
<MicrosoftNativeQuicMsQuicVersion>2.2.3</MicrosoftNativeQuicMsQuicVersion>
<SystemNetMsQuicTransportVersion>7.0.0-alpha.1.22459.1</SystemNetMsQuicTransportVersion>
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/coreclr/templates/helix-queues-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
- (Alpine.314.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.14-helix-amd64
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- (Alpine.314.Amd64)ubuntu.1604.amd64@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.14-helix-amd64
- (Alpine.314.Amd64)ubuntu.2204.amd64.svc@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.14-helix-amd64

# Linux musl arm32
- ${{ if eq(parameters.platform, 'Linux_musl_arm') }}:
Expand Down
6 changes: 3 additions & 3 deletions eng/pipelines/libraries/helix-queues-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ jobs:
- (Fedora.34.Amd64.Open)ubuntu.1804.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-34-helix
- Ubuntu.2204.Amd64.Open
- (Debian.11.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-11-helix-amd64
- (Mariner.1.0.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-1.0-helix
- (openSUSE.15.2.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:opensuse-15.2-helix-amd64
- (Mariner.1.0.Amd64.Open)ubuntu.2204.amd64.open.svc@mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-1.0-helix
- (openSUSE.15.2.Amd64.Open)ubuntu.2204.amd64.open.svc@mcr.microsoft.com/dotnet-buildtools/prereqs:opensuse-15.2-helix-amd64
- ${{ if or(ne(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}:
- (Centos.7.Amd64.Open)Ubuntu.1604.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-mlnet-helix
- (Centos.7.Amd64.Open)Ubuntu.2204.Amd64.Open.svc@mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-mlnet-helix
- RedHat.7.Amd64.Open
- (Debian.10.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-10-helix-amd64
- Ubuntu.1804.Amd64.Open
Expand Down
1 change: 1 addition & 0 deletions eng/pipelines/runtime-wasm-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# UI to this, and thus avoid any scheduled triggers

trigger: none
pr: none

variables:
- template: /eng/pipelines/common/variables.yml
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/inc/clrconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,8 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_UnfairSemaphoreSpinLimit, W("Thread
#else // !TARGET_ARM64
RETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_UnfairSemaphoreSpinLimit, W("ThreadPool_UnfairSemaphoreSpinLimit"), 0x46, "Maximum number of spins a thread pool worker thread performs before waiting for work")
#endif // TARGET_ARM64
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_ThreadPool_ThreadTimeoutMs, W("ThreadPool_ThreadTimeoutMs"), (DWORD)-2, "The amount of time in milliseconds a thread pool thread waits without having done any work before timing out and exiting. Set to -1 to disable the timeout. Applies to worker threads, completion port threads, and wait threads. Also see the ThreadPool_ThreadsToKeepAlive config value for relevant information.", CLRConfig::LookupOptions::ParseIntegerAsBase10)
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_ThreadPool_ThreadsToKeepAlive, W("ThreadPool_ThreadsToKeepAlive"), 0, "The number of worker or completion port threads to keep alive after they are created. Set to -1 to keep all created worker or completion port threads alive. When the ThreadPool_ThreadTimeoutMs config value is also set, for worker and completion port threads the timeout applies to threads in the respective pool that are in excess of the number configured for ThreadPool_ThreadsToKeepAlive.", CLRConfig::LookupOptions::ParseIntegerAsBase10)

RETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_Disable, W("HillClimbing_Disable"), 0, "Disables hill climbing for thread adjustments in the thread pool");
RETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_WavePeriod, W("HillClimbing_WavePeriod"), 4, "");
Expand Down
8 changes: 8 additions & 0 deletions src/coreclr/inc/safemath.h
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,10 @@ template<typename T> class ClrSafeInt
INDEBUG( mutable bool m_checkedOverflow; )
};

#if defined(_MSC_VER) && defined(HOST_ARM64) // Workaround for https://github.com/dotnet/runtime/issues/93442
#pragma optimize("", off)
#endif

template <>
inline bool ClrSafeInt<int64_t>::multiply(int64_t lhs, int64_t rhs, int64_t &result)
{
Expand Down Expand Up @@ -874,6 +878,10 @@ inline bool ClrSafeInt<uint8_t>::multiply(uint8_t lhs, uint8_t rhs, uint8_t &res
return true;
}

#if defined(_MSC_VER) && defined(HOST_ARM64) // Workaround for https://github.com/dotnet/runtime/issues/93442
#pragma optimize("", on)
#endif

// Allows creation of a ClrSafeInt corresponding to the type of the argument.
template <typename T>
ClrSafeInt<T> AsClrSafeInt(T t)
Expand Down
28 changes: 28 additions & 0 deletions src/coreclr/vm/comthreadpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,34 @@ FCIMPL4(INT32, ThreadPoolNative::GetNextConfigUInt32Value,
case 19: if (TryGetConfig(CLRConfig::INTERNAL_HillClimbing_SampleIntervalHigh, false, W("System.Threading.ThreadPool.HillClimbing.SampleIntervalHigh"))) { return 20; } FALLTHROUGH;
case 20: if (TryGetConfig(CLRConfig::INTERNAL_HillClimbing_GainExponent, false, W("System.Threading.ThreadPool.HillClimbing.GainExponent"))) { return 21; } FALLTHROUGH;

case 21:
{
int threadPoolThreadTimeoutMs = g_pConfig->ThreadPoolThreadTimeoutMs();
if (threadPoolThreadTimeoutMs >= -1)
{
*configValueRef = (UINT32)threadPoolThreadTimeoutMs;
*isBooleanRef = false;
*appContextConfigNameRef = W("System.Threading.ThreadPool.ThreadTimeoutMs");
return 22;
}

FALLTHROUGH;
}

case 22:
{
int threadPoolThreadsToKeepAlive = g_pConfig->ThreadPoolThreadsToKeepAlive();
if (threadPoolThreadsToKeepAlive >= -1)
{
*configValueRef = (UINT32)threadPoolThreadsToKeepAlive;
*isBooleanRef = false;
*appContextConfigNameRef = W("System.Threading.ThreadPool.ThreadsToKeepAlive");
return 23;
}

FALLTHROUGH;
}

default:
*configValueRef = 0;
*isBooleanRef = false;
Expand Down
16 changes: 16 additions & 0 deletions src/coreclr/vm/eeconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ HRESULT EEConfig::Init()
bDiagnosticSuspend = false;
#endif

threadPoolThreadTimeoutMs = -2; // not configured
threadPoolThreadsToKeepAlive = 0;

#if defined(FEATURE_TIERED_COMPILATION)
fTieredCompilation = false;
fTieredCompilation_QuickJit = false;
Expand Down Expand Up @@ -668,6 +671,19 @@ HRESULT EEConfig::sync()

#endif //_DEBUG

threadPoolThreadTimeoutMs =
(int)Configuration::GetKnobDWORDValue(
W("System.Threading.ThreadPool.ThreadTimeoutMs"),
CLRConfig::EXTERNAL_ThreadPool_ThreadTimeoutMs);
threadPoolThreadsToKeepAlive =
(int)Configuration::GetKnobDWORDValue(
W("System.Threading.ThreadPool.ThreadsToKeepAlive"),
CLRConfig::EXTERNAL_ThreadPool_ThreadsToKeepAlive);
if (threadPoolThreadsToKeepAlive < -1)
{
threadPoolThreadsToKeepAlive = 0;
}

m_fInteropValidatePinnedObjects = (CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_InteropValidatePinnedObjects) != 0);
m_fInteropLogArguments = (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_InteropLogArguments) != 0);

Expand Down
6 changes: 6 additions & 0 deletions src/coreclr/vm/eeconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,9 @@ class EEConfig

#endif

int ThreadPoolThreadTimeoutMs() const { LIMITED_METHOD_CONTRACT; return threadPoolThreadTimeoutMs; }
int ThreadPoolThreadsToKeepAlive() const { LIMITED_METHOD_CONTRACT; return threadPoolThreadsToKeepAlive; }

private: //----------------------------------------------------------------

bool fInited; // have we synced to the registry at least once?
Expand Down Expand Up @@ -644,6 +647,9 @@ class EEConfig
DWORD testThreadAbort;
#endif

int threadPoolThreadTimeoutMs;
int threadPoolThreadsToKeepAlive;

#if defined(FEATURE_TIERED_COMPILATION)
bool fTieredCompilation;
bool fTieredCompilation_QuickJit;
Expand Down
26 changes: 0 additions & 26 deletions src/coreclr/vm/ilmarshalers.h
Original file line number Diff line number Diff line change
Expand Up @@ -3138,39 +3138,13 @@ class ILMngdMarshaler : public ILMarshaler
void EmitClearNative(ILCodeStream* pslILEmit) override
{
WRAPPER_NO_CONTRACT;
ILCodeLabel* pNoManagedValueLabel = nullptr;
if (IsFieldMarshal(m_dwMarshalFlags))
{
pNoManagedValueLabel = pslILEmit->NewCodeLabel();
pslILEmit->EmitLDARG(StructMarshalStubs::MANAGED_STRUCT_ARGIDX);
pslILEmit->EmitBRFALSE(pNoManagedValueLabel);
}

EmitCallMngdMarshalerMethod(pslILEmit, GetClearNativeMethod());

if (IsFieldMarshal(m_dwMarshalFlags))
{
pslILEmit->EmitLabel(pNoManagedValueLabel);
}
}

void EmitClearNativeContents(ILCodeStream* pslILEmit) override
{
WRAPPER_NO_CONTRACT;
ILCodeLabel* pNoManagedValueLabel = nullptr;
if (IsFieldMarshal(m_dwMarshalFlags))
{
pNoManagedValueLabel = pslILEmit->NewCodeLabel();
pslILEmit->EmitLDARG(StructMarshalStubs::MANAGED_STRUCT_ARGIDX);
pslILEmit->EmitBRFALSE(pNoManagedValueLabel);
}

EmitCallMngdMarshalerMethod(pslILEmit, GetClearNativeContentsMethod());

if (IsFieldMarshal(m_dwMarshalFlags))
{
pslILEmit->EmitLabel(pNoManagedValueLabel);
}
}

bool NeedsClearCLR() override
Expand Down
12 changes: 11 additions & 1 deletion src/coreclr/vm/methodtablebuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6871,9 +6871,15 @@ VOID MethodTableBuilder::AllocAndInitMethodDescs()
SIZE_T sizeOfMethodDescs = 0; // current running size of methodDesc chunk
int startIndex = 0; // start of the current chunk (index into bmtMethod array)

// Limit the maximum MethodDescs per chunk by the number of precodes that can fit to a single memory page,
// since we allocate consecutive temporary entry points for all MethodDescs in the whole chunk.
DWORD maxPrecodesPerPage = Precode::GetMaxTemporaryEntryPointsCount();
DWORD methodDescCount = 0;

DeclaredMethodIterator it(*this);
while (it.Next())
{
DWORD currentSlotMethodDescCount = 1;
int tokenRange = GetTokenRange(it.Token());

// This code assumes that iterator returns tokens in ascending order. If this assumption does not hold,
Expand All @@ -6896,6 +6902,7 @@ VOID MethodTableBuilder::AllocAndInitMethodDescs()
// See comment in AllocAndInitMethodDescChunk
if (NeedsTightlyBoundUnboxingStub(*it))
{
currentSlotMethodDescCount = 2;
size *= 2;

if (bmtGenerics->GetNumGenericArgs() == 0) {
Expand All @@ -6907,7 +6914,8 @@ VOID MethodTableBuilder::AllocAndInitMethodDescs()
}

if (tokenRange != currentTokenRange ||
sizeOfMethodDescs + size > MethodDescChunk::MaxSizeOfMethodDescs)
sizeOfMethodDescs + size > MethodDescChunk::MaxSizeOfMethodDescs ||
methodDescCount + currentSlotMethodDescCount > maxPrecodesPerPage)
{
if (sizeOfMethodDescs != 0)
{
Expand All @@ -6917,9 +6925,11 @@ VOID MethodTableBuilder::AllocAndInitMethodDescs()

currentTokenRange = tokenRange;
sizeOfMethodDescs = 0;
methodDescCount = 0;
}

sizeOfMethodDescs += size;
methodDescCount += currentSlotMethodDescCount;
}

if (sizeOfMethodDescs != 0)
Expand Down
Loading

0 comments on commit bad10ca

Please sign in to comment.