scheduler: Improve power saving mode, part 2

Consequences of committing & pushing too quickly...
This commit is contained in:
Pawel Dziepak
2013-11-20 21:21:31 +01:00
parent ecfd444935
commit 683b9bbf07
+7 -8
View File
@@ -110,8 +110,8 @@ should_rebalance(Thread* thread)
CoreEntry* coreEntry = &gCoreEntries[core];
if (coreEntry->fLoad > kHighLoad) {
SpinLocker coreLocker(gCoreHeapsLock);
if (sSmallTaskCore == core) {
SpinLocker coreLocker(gCoreHeapsLock);
CoreEntry* other = gCoreLoadHeap->PeekMaximum();
if (other == NULL)
@@ -122,15 +122,14 @@ should_rebalance(Thread* thread)
sSmallTaskCore = other->fCoreID;
return coreEntry->fLoad > kVeryHighLoad;
}
} else if (coreEntry->fLoad < kHighLoad) {
int32 newCore = choose_small_task_core();
return newCore != core;
CoreEntry* other = gCoreHighLoadHeap->PeekMinimum();
if (other == NULL)
other = gCoreHighLoadHeap->PeekMaximum();
return coreEntry->fLoad - other->fLoad >= kLoadDifference / 2;
}
CoreEntry* other = gCoreHighLoadHeap->PeekMinimum();
if (other == NULL)
return false;
return coreEntry->fLoad - other->fLoad >= kLoadDifference / 2;
return choose_small_task_core() != core;
}