From 4835c216f783497c2a8e1bc8eea073925597148d Mon Sep 17 00:00:00 2001 From: Pawel Dziepak Date: Thu, 16 Jan 2014 23:45:28 +0100 Subject: [PATCH] scheduler: low_latency: Try to keep all cores busy --- src/system/kernel/scheduler/low_latency.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/system/kernel/scheduler/low_latency.cpp b/src/system/kernel/scheduler/low_latency.cpp index 20555e582c..911353f2a1 100644 --- a/src/system/kernel/scheduler/low_latency.cpp +++ b/src/system/kernel/scheduler/low_latency.cpp @@ -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; }