Skip to content

Commit 87bbad1

Browse files
committed
Start with conservative spin count multiplier
1 parent e6f1fd8 commit 87bbad1

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/coreclr/gc/gc.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14243,10 +14243,13 @@ HRESULT gc_heap::initialize_gc (size_t soh_segment_size,
1424314243

1424414244
#endif //MULTIPLE_HEAPS
1424514245

14246+
// Start with low conservative spin count that will be bumped up by spin count recalibration in the background.
14247+
yp_spin_count_unit = 10;
14248+
1424614249
#ifdef MULTIPLE_HEAPS
14247-
yp_spin_count_unit = 32 * number_of_heaps;
14250+
original_spin_count_unit = 32 * number_of_heaps;
1424814251
#else
14249-
yp_spin_count_unit = 32 * g_num_processors;
14252+
original_spin_count_unit = 32 * g_num_processors;
1425014253
#endif //MULTIPLE_HEAPS
1425114254

1425214255
// Check if the values are valid for the spin count if provided by the user
@@ -14255,11 +14258,9 @@ HRESULT gc_heap::initialize_gc (size_t soh_segment_size,
1425514258
gc_heap::spin_count_unit_config_p = (spin_count_unit_from_config > 0) && (spin_count_unit_from_config <= MAX_YP_SPIN_COUNT_UNIT);
1425614259
if (gc_heap::spin_count_unit_config_p)
1425714260
{
14258-
yp_spin_count_unit = static_cast<int32_t>(spin_count_unit_from_config);
14261+
yp_spin_count_unit = original_spin_count_unit = static_cast<int32_t>(spin_count_unit_from_config);
1425914262
}
1426014263

14261-
original_spin_count_unit = yp_spin_count_unit;
14262-
1426314264
#if defined(__linux__)
1426414265
GCToEEInterface::UpdateGCEventStatus(static_cast<int>(GCEventStatus::GetEnabledLevel(GCEventProvider_Default)),
1426514266
static_cast<int>(GCEventStatus::GetEnabledKeywords(GCEventProvider_Default)),

0 commit comments

Comments
 (0)