mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-08 11:37:04 +09:00
gc spin tweak
This commit is contained in:
parent
b946f457f6
commit
c02e083cfd
3 changed files with 6 additions and 8 deletions
|
@ -197,12 +197,12 @@ void SatoriRecycler::HelperThreadFn(void* param)
|
||||||
goto released;
|
goto released;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: VS revisit the value of spinning
|
|
||||||
if (recycler->maySpinAtGate)
|
if (recycler->maySpinAtGate)
|
||||||
{
|
{
|
||||||
// spin for ~10 microseconds
|
// spin for ~10 microseconds (GcSpin)
|
||||||
int64_t limit = GCToOSInterface::QueryPerformanceCounter() +
|
int64_t limit = GCToOSInterface::QueryPerformanceCounter() +
|
||||||
recycler->m_perfCounterTicksPerMicro * SatoriUtil::GcSpin();
|
recycler->m_perfCounterTicksPerMicro * SatoriUtil::GcSpin();
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -702,6 +702,7 @@ void SatoriRecycler::BlockingMarkForConcurrent()
|
||||||
|
|
||||||
// signal to everybody to start marking roots
|
// signal to everybody to start marking roots
|
||||||
VolatileStore((int*)&m_ccStackMarkState, CC_MARK_STATE_MARKING);
|
VolatileStore((int*)&m_ccStackMarkState, CC_MARK_STATE_MARKING);
|
||||||
|
m_helperGate->WakeAll();
|
||||||
|
|
||||||
// mark demoted regions if any attached to thread contexts
|
// mark demoted regions if any attached to thread contexts
|
||||||
MarkContext c(this);
|
MarkContext c(this);
|
||||||
|
@ -3623,7 +3624,6 @@ void SatoriRecycler::Update()
|
||||||
IncrementCardScanTicket();
|
IncrementCardScanTicket();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: VS revisit value of WakeAll()
|
|
||||||
m_helperGate->WakeAll();
|
m_helperGate->WakeAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3843,7 +3843,7 @@ void SatoriRecycler::UpdateRegions(SatoriRegionQueue* queue)
|
||||||
{
|
{
|
||||||
curRegion->MakeBlank();
|
curRegion->MakeBlank();
|
||||||
// TODO: VS use ReturnRegionNoLock in more places? (or less?)
|
// TODO: VS use ReturnRegionNoLock in more places? (or less?)
|
||||||
// what about work chunk queue, can that be lock-free?
|
// what about work chunk queue? that be lock-free.
|
||||||
m_heap->Allocator()->ReturnRegionNoLock(curRegion);
|
m_heap->Allocator()->ReturnRegionNoLock(curRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,9 +126,6 @@ public:
|
||||||
&m_lastEphemeralGcInfo;
|
&m_lastEphemeralGcInfo;
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: VS needs to be public?
|
|
||||||
bool IsBlockingPhase();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SatoriHeap* m_heap;
|
SatoriHeap* m_heap;
|
||||||
|
|
||||||
|
@ -308,6 +305,7 @@ private:
|
||||||
void BlockingCollect1();
|
void BlockingCollect1();
|
||||||
void BlockingCollect2();
|
void BlockingCollect2();
|
||||||
void BlockingCollectImpl();
|
void BlockingCollectImpl();
|
||||||
|
bool IsBlockingPhase();
|
||||||
|
|
||||||
void BlockingMark();
|
void BlockingMark();
|
||||||
void MarkNewReachable();
|
void MarkNewReachable();
|
||||||
|
|
|
@ -271,7 +271,7 @@ public:
|
||||||
int gcSpin = (int)GCConfig::GetGCSpin();
|
int gcSpin = (int)GCConfig::GetGCSpin();
|
||||||
if (gcSpin == -1)
|
if (gcSpin == -1)
|
||||||
{
|
{
|
||||||
return 5;
|
return 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
return gcSpin;
|
return gcSpin;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue