Support 'System.GC.LargePages' in runtimeconfig.json (#34329)
authorAndrew Au <andrewau@microsoft.com>
Wed, 8 Apr 2020 06:35:41 +0000 (23:35 -0700)
committerGitHub <noreply@github.com>
Wed, 8 Apr 2020 06:35:41 +0000 (23:35 -0700)
src/coreclr/src/inc/clrconfigvalues.h
src/coreclr/src/vm/eeconfig.cpp
src/coreclr/src/vm/gcenv.ee.cpp
src/coreclr/src/vm/gcenv.ee.standalone.cpp
src/coreclr/src/vm/gcenv.ee.static.cpp

index fc711dc..fb643f4 100644 (file)
@@ -315,7 +315,7 @@ RETAIL_CONFIG_STRING_INFO(EXTERNAL_GCName, W("GCName"), "")
 RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_GCHeapHardLimit, W("GCHeapHardLimit"), "Specifies the maximum commit size for the GC heap")
 RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_GCHeapHardLimitPercent, W("GCHeapHardLimitPercent"), "Specifies the GC heap usage as a percentage of the total memory")
 RETAIL_CONFIG_STRING_INFO(EXTERNAL_GCHeapAffinitizeRanges, W("GCHeapAffinitizeRanges"), "Specifies list of processors for Server GC threads. The format is a comma separated list of processor numbers or ranges of processor numbers. Example: 1,3,5,7-9,12")
-RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_GCLargePages, W("GCLargePages"), "Specifies whether large pages should be used when a heap hard limit is set")
+RETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCLargePages, W("GCLargePages"), 0, "Specifies whether large pages should be used when a heap hard limit is set")
 
 ///
 /// IBC
index c976380..7147136 100644 (file)
@@ -480,16 +480,16 @@ fTrackDynamicMethodDebugInfo = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_
 #endif
 
     bool gcConcurrentWasForced = false;
-    // The CLRConfig value for UNSUPPORTED_gcConcurrent defaults to -1, and treats any
-    // positive value as 'forcing' concurrent GC to be on. Because the standard logic
-    // for mapping a DWORD CLRConfig to a boolean configuration treats -1 as true (just
-    // like any other nonzero value), we will explicitly check the DWORD later if this
-    // check returns false.
     gcConcurrentWasForced = Configuration::GetKnobBooleanValue(W("System.GC.Concurrent"), false);
 
     int gcConcurrentConfigVal = 0;
     if (!gcConcurrentWasForced)
     {
+        // The CLRConfig value for UNSUPPORTED_gcConcurrent defaults to -1, and treats any
+        // positive value as 'forcing' concurrent GC to be on. Because the standard logic
+        // for mapping a DWORD CLRConfig to a boolean configuration treats -1 as true (just
+        // like any other nonzero value), we will explicitly check the DWORD later if this
+        // check returns false.
         gcConcurrentConfigVal = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_gcConcurrent);
         gcConcurrentWasForced = (gcConcurrentConfigVal > 0);
     }
index 8352bb6..53566be 100644 (file)
@@ -1049,6 +1049,12 @@ bool GCToEEInterface::GetBooleanConfigValue(const char* key, bool* value)
         return true;
     }
 
+    if (strcmp(key, "GCLargePages") == 0)
+    {
+        *value = Configuration::GetKnobBooleanValue(W("System.GC.LargePages"), CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_GCLargePages));
+        return true;
+    }
+
     WCHAR configKey[MaxConfigKeyLength];
     if (MultiByteToWideChar(CP_ACP, 0, key, -1 /* key is null-terminated */, configKey, MaxConfigKeyLength) == 0)
     {
index 5d6a58d..a52daea 100644 (file)
@@ -15,6 +15,7 @@
 #endif // FEATURE_COMINTEROP
 
 #include "gctoclreventsink.h"
+#include "configuration.h"
 
 // the method table for the WeakReference class
 extern MethodTable* pWeakReferenceMT;
index 697fed5..b3802e5 100644 (file)
@@ -15,6 +15,7 @@
 #endif // FEATURE_COMINTEROP
 
 #include "gctoclreventsink.h"
+#include "configuration.h"
 
 // the method table for the WeakReference class
 extern MethodTable* pWeakReferenceMT;