scheduler: low_latency: Try to keep all cores busy

This commit is contained in:
Pawel Dziepak 2014-01-16 23:45:28 +01:00
parent 0d27a57cf1
commit 4835c216f7
1 changed files with 5 additions and 1 deletions

View File

@ -101,10 +101,14 @@ should_rebalance(const ThreadData* threadData)
// No cpu bound threads - the situation is quite good. Make sure it
// won't get much worse...
ReadSpinLocker coreLocker(gCoreHeapsLock);
CoreEntry* other = gCoreLoadHeap.PeekMinimum();
if (other == NULL)
other = gCoreHighLoadHeap.PeekMinimum();
coreLocker.Unlock();
if (other->GetLoad() == 0 && coreNewLoad != 0)
return true;
int32 otherNewLoad = other->GetLoad() + threadLoad;
return coreNewLoad - otherNewLoad >= kLoadDifference * 2;
}