summaryrefslogtreecommitdiff
path: root/src/gc/gc.cpp
diff options
context:
space:
mode:
authorKoundinya Veluri <kouvel@users.noreply.github.com>2019-01-10 17:51:53 -0800
committerGitHub <noreply@github.com>2019-01-10 17:51:53 -0800
commit616fea550548af750b575f3c304d1a9b4b6ef9a6 (patch)
treedc5468ff6b745ef2aac69e899f9616a494dd48a9 /src/gc/gc.cpp
parent459b58a7766707fb059a5762c7d72cb0af42a6ff (diff)
downloadcoreclr-616fea550548af750b575f3c304d1a9b4b6ef9a6.tar.gz
coreclr-616fea550548af750b575f3c304d1a9b4b6ef9a6.tar.bz2
coreclr-616fea550548af750b575f3c304d1a9b4b6ef9a6.zip
Normalize a few more spin-wait loops (#21586)
Normalize a few more spin-wait loops - Fixed a few more spin-waits to normalize the spin-wait duration between processors - These spin-waits have so far not needed to be retuned to avoid unreasonably long spin-wait durations. They can be retuned as necessary in the future. - Added a version of YieldProcessorNormalized() that normalizes based on spin-wait counts tuned for pre-Skylake processors for spin-wait loops that have not been retuned. - Moved some files around to make YieldProcessorNormalized() and the like available in more places. Initialization is still only done in the VM. Uses outside the VM will use the defaults, where there would be no significant change from before. - Made YieldProcessor() private outside of the GC and added System_YieldProcessor() for when the system-defined implementation is intended to be used
Diffstat (limited to 'src/gc/gc.cpp')
-rw-r--r--src/gc/gc.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp
index 5bad11cf8e..921da851ea 100644
--- a/src/gc/gc.cpp
+++ b/src/gc/gc.cpp
@@ -1633,7 +1633,7 @@ void WaitLongerNoInstru (int i)
{
if (g_num_processors > 1)
{
- YieldProcessor(); // indicate to the processor that we are spining
+ YieldProcessor(); // indicate to the processor that we are spinning
if (i & 0x01f)
GCToOSInterface::YieldThread (0);
else
@@ -1706,7 +1706,7 @@ retry:
{
if (VolatileLoad(lock) < 0 || IsGCInProgress())
break;
- YieldProcessor(); // indicate to the processor that we are spining
+ YieldProcessor(); // indicate to the processor that we are spinning
}
if (VolatileLoad(lock) >= 0 && !IsGCInProgress())
{
@@ -1801,7 +1801,7 @@ void WaitLonger (int i
#endif //SYNCHRONIZATION_STATS
if (g_num_processors > 1)
{
- YieldProcessor(); // indicate to the processor that we are spining
+ YieldProcessor(); // indicate to the processor that we are spinning
if (i & 0x01f)
GCToOSInterface::YieldThread (0);
else
@@ -1852,7 +1852,7 @@ retry:
{
if (spin_lock->lock < 0 || gc_heap::gc_started)
break;
- YieldProcessor(); // indicate to the processor that we are spining
+ YieldProcessor(); // indicate to the processor that we are spinning
}
if (spin_lock->lock >= 0 && !gc_heap::gc_started)
{
@@ -10332,7 +10332,7 @@ retry:
{
if (gc_done_event_lock < 0)
break;
- YieldProcessor(); // indicate to the processor that we are spining
+ YieldProcessor(); // indicate to the processor that we are spinning
}
if (gc_done_event_lock >= 0)
GCToOSInterface::YieldThread(++dwSwitchCount);
@@ -36251,7 +36251,7 @@ retry:
unsigned int i = 0;
while (lock >= 0)
{
- YieldProcessor(); // indicate to the processor that we are spining
+ YieldProcessor(); // indicate to the processor that we are spinning
if (++i & 7)
GCToOSInterface::YieldThread (0);
else