enable DATAS config via runtimeconfig.json (#87034)
authorManish Godse <61718172+mangod9@users.noreply.github.com>
Sat, 3 Jun 2023 01:27:16 +0000 (18:27 -0700)
committerGitHub <noreply@github.com>
Sat, 3 Jun 2023 01:27:16 +0000 (18:27 -0700)
* enable DTAS config via runtimeconfig.json

* updating config name and switching it to INT_CONFIG

src/coreclr/gc/gc.cpp
src/coreclr/gc/gcconfig.h

index 5409d99a5380d904389208f74cae73255e77241e..f4092220d74fe5e54406f9c8febef98cf506bd9e 100644 (file)
@@ -14170,7 +14170,7 @@ gc_heap::init_semi_shared()
 #ifdef MULTIPLE_HEAPS
     mark_list_size = min (100*1024, max (8192, soh_segment_size/(2*10*32)));
 #ifdef DYNAMIC_HEAP_COUNT
-    if (GCConfig::GetGCDynamicAdaptation() && GCConfig::GetHeapCount() == 0)
+    if (GCConfig::GetGCDynamicAdaptationMode() == 1 && GCConfig::GetHeapCount() == 0)
     {
         // we'll actually start with one heap in this case
         g_mark_list_total_size = mark_list_size;
@@ -14380,7 +14380,7 @@ gc_heap::init_semi_shared()
 #endif //FEATURE_EVENT_TRACE
 
     conserve_mem_setting  = (int)GCConfig::GetGCConserveMem();
-    if (conserve_mem_setting == 0 && GCConfig::GetGCDynamicAdaptation())
+    if (conserve_mem_setting == 0 && GCConfig::GetGCDynamicAdaptationMode() == 1)
         conserve_mem_setting = 5;
     if (conserve_mem_setting < 0)
         conserve_mem_setting = 0;
@@ -24882,7 +24882,7 @@ void gc_heap::check_heap_count ()
         return;
     }
 
-    if (!GCConfig::GetGCDynamicAdaptation())
+    if (GCConfig::GetGCDynamicAdaptationMode() == 0)
     {
         // don't change the heap count dynamically if the feature isn't explicitly enabled
         return;        
@@ -48067,7 +48067,7 @@ HRESULT GCHeap::Initialize()
     {
 #ifdef DYNAMIC_HEAP_COUNT
         // if no heap count was specified, and we are told to adjust heap count dynamically ...
-        if (GCConfig::GetHeapCount() == 0 && GCConfig::GetGCDynamicAdaptation())
+        if (GCConfig::GetHeapCount() == 0 && GCConfig::GetGCDynamicAdaptationMode() == 1)
         {
             // ... start with only 1 heap
             gc_heap::g_heaps[0]->change_heap_count (1);
@@ -50509,7 +50509,7 @@ size_t gc_heap::get_gen0_min_size()
         int n_heaps = 1;
 #endif //SERVER_GC
 
-        if (GCConfig::GetGCConserveMem() != 0 || GCConfig::GetGCDynamicAdaptation())
+        if (GCConfig::GetGCConserveMem() != 0 || GCConfig::GetGCDynamicAdaptationMode() == 1)
         {
             // if we are asked to be stingy with memory, limit gen 0 size
             gen0size = min (gen0size, (4*1024*1024));
index e5a551baa37d5e78e947fe7e6f2a42011e9440d8..72786778d5a978a3099384475bb8d79d0e4f36eb 100644 (file)
@@ -138,7 +138,7 @@ public:
     INT_CONFIG   (GCWriteBarrier,            "GCWriteBarrier",            NULL,                                0,                  "Specifies whether GC should use more precise but slower write barrier")                  \
     STRING_CONFIG(GCName,                    "GCName",                    "System.GC.Name",                                        "Specifies the path of the standalone GC implementation.")                                \
     INT_CONFIG   (GCSpinCountUnit,           "GCSpinCountUnit",           0,                                   0,                  "Specifies the spin count unit used by the GC.")                                          \
-    BOOL_CONFIG  (GCDynamicAdaptation,       "GCDynamicAdaptation",       NULL,                                false,              "Enables varying the heap count dynamically in Server GC.")
+    INT_CONFIG   (GCDynamicAdaptationMode,   "GCDynamicAdaptationMode",   "System.GC.DynamicAdaptationMode",   0,                  "Enable the GC to dynamically adapt to application sizes.")
 // This class is responsible for retreiving configuration information
 // for how the GC should operate.
 class GCConfig