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
+5 -6
View File
@@ -110,8 +110,8 @@ should_rebalance(Thread* thread)
CoreEntry* coreEntry = &gCoreEntries[core]; CoreEntry* coreEntry = &gCoreEntries[core];
if (coreEntry->fLoad > kHighLoad) { if (coreEntry->fLoad > kHighLoad) {
if (sSmallTaskCore == core) {
SpinLocker coreLocker(gCoreHeapsLock); SpinLocker coreLocker(gCoreHeapsLock);
if (sSmallTaskCore == core) {
CoreEntry* other = gCoreLoadHeap->PeekMaximum(); CoreEntry* other = gCoreLoadHeap->PeekMaximum();
if (other == NULL) if (other == NULL)
@@ -122,15 +122,14 @@ should_rebalance(Thread* thread)
sSmallTaskCore = other->fCoreID; sSmallTaskCore = other->fCoreID;
return coreEntry->fLoad > kVeryHighLoad; return coreEntry->fLoad > kVeryHighLoad;
} }
} else if (coreEntry->fLoad < kHighLoad) {
int32 newCore = choose_small_task_core();
return newCore != core;
}
CoreEntry* other = gCoreHighLoadHeap->PeekMinimum(); CoreEntry* other = gCoreHighLoadHeap->PeekMinimum();
if (other == NULL) if (other == NULL)
return false; other = gCoreHighLoadHeap->PeekMaximum();
return coreEntry->fLoad - other->fLoad >= kLoadDifference / 2; return coreEntry->fLoad - other->fLoad >= kLoadDifference / 2;
}
return choose_small_task_core() != core;
} }