Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Mosier <smosier@microsoft.com>2016-07-23 01:20:01 +0300
committerScott Mosier <smosier@microsoft.com>2016-07-23 01:20:01 +0300
commit0683b3c358663b09096006a3ba522ac2748e79a8 (patch)
treeeefbaadbaa668786f8ff29fac09c187c8594fbe0 /src/Native/Runtime/windows
parent5c95f2b2738c2a03409c78cf2a4002d9b0461a47 (diff)
GC fixes for server GC in CoreRT
- g_mark_stack_busy should be declared as 'int*' instead of 'BOOL*' - fix some unreferenced parameter errors when building server GC - fix some code to use Interlocked / GCToEEInterface - fix frozen_object_p for server GC - add NumaNodeInfo / CPUGroupInfo shells with non-useful implementations MRT changes for server GC - Add RH_UseServerGC config setting - Fix startup to init the GC to the right kind based on the config setting - Fix GCToOSInterface::CreateThread to pass the right value to the stub thread Build changes to stand up "mrt150.dll" - Add a new DLL to the build, called mrt150.dll. This DLL is targeting win32 (not UWP-restricted) APIs, contains both WKS and SVR GCs, and statically links the CRT. This is just an initial prototype, so none of this is set in stone. This DLL can be tested by renaming it to mrt100_app.dll. :-) - update the AddNutcExports.pl script to wrap any exports that get forwarded to the CRT in a macro. These macros change based on whether or not we're statically linking the CRT. If we are (i.e. mrt150.dll), they just export the API, if we aren't (i.e. mrt100_app.dll), then they forward to the correct CRT DLL. I presume that Server GC isn't 100% configured correctly on PN, because this is the first time it has been run like this and there are still a bunch of #ifdef FEATURE_REDHAWK / CORECLR / etc. that haven't necessarily been rationalized against our desire to converge the configurations across runtimes. [tfs-changeset: 1619005]
Diffstat (limited to 'src/Native/Runtime/windows')
-rw-r--r--src/Native/Runtime/windows/PalRedhawkMinWin.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/Native/Runtime/windows/PalRedhawkMinWin.cpp b/src/Native/Runtime/windows/PalRedhawkMinWin.cpp
index cb1493906..cfffb8455 100644
--- a/src/Native/Runtime/windows/PalRedhawkMinWin.cpp
+++ b/src/Native/Runtime/windows/PalRedhawkMinWin.cpp
@@ -1381,7 +1381,7 @@ bool GCToOSInterface::SetCurrentThreadIdealAffinity(GCThreadAffinity* affinity)
{
proc.Number = (BYTE)affinity->Processor;
success = !!SetThreadIdealProcessorEx(GetCurrentThread(), &proc, NULL);
- }
+ }
}
return success;
@@ -1564,7 +1564,7 @@ size_t GCToOSInterface::GetLargestOnDieCacheSize(bool trueSize)
// specify a 1 bit for a processor when the system affinity mask specifies a 0 bit for that processor.
bool GCToOSInterface::GetCurrentProcessAffinityMask(uintptr_t* processMask, uintptr_t* systemMask)
{
- return false;
+ return !!::GetProcessAffinityMask(GetCurrentProcess(), (PDWORD_PTR)processMask, (PDWORD_PTR)systemMask);
}
// Get number of processors assigned to the current process
@@ -1749,7 +1749,7 @@ bool GCToOSInterface::CreateThread(GCThreadFunction function, void* param, GCThr
stubParam->GCThreadParam = param;
DWORD thread_id;
- HANDLE gc_thread = ::CreateThread(0, 4096, GCThreadStub, &stubParam, CREATE_SUSPENDED, &thread_id);
+ HANDLE gc_thread = ::CreateThread(0, 4096, GCThreadStub, stubParam.GetValue(), CREATE_SUSPENDED, &thread_id);
if (!gc_thread)
{
@@ -1760,6 +1760,24 @@ bool GCToOSInterface::CreateThread(GCThreadFunction function, void* param, GCThr
SetThreadPriority(gc_thread, /* THREAD_PRIORITY_ABOVE_NORMAL );*/ THREAD_PRIORITY_HIGHEST );
+ if (affinity->Group != GCThreadAffinity::None)
+ {
+ // @TODO: CPUGroupInfo
+
+ // ASSERT(affinity->Processor != GCThreadAffinity::None);
+ // GROUP_AFFINITY ga;
+ // ga.Group = (WORD)affinity->Group;
+ // ga.Reserved[0] = 0;
+ // ga.Reserved[1] = 0;
+ // ga.Reserved[2] = 0;
+ // ga.Mask = (size_t)1 << affinity->Processor;
+ // CPUGroupInfo::SetThreadGroupAffinity(gc_thread, &ga, NULL);
+ }
+ else if (affinity->Processor != GCThreadAffinity::None)
+ {
+ SetThreadAffinityMask(gc_thread, (DWORD_PTR)1 << affinity->Processor);
+ }
+
ResumeThread(gc_thread);
CloseHandle(gc_thread);