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]; CoreEntry* coreEntry = &gCoreEntries[core];
if (coreEntry->fLoad > kHighLoad) { if (coreEntry->fLoad > kHighLoad) {
SpinLocker coreLocker(gCoreHeapsLock);
if (sSmallTaskCore == core) { if (sSmallTaskCore == core) {
SpinLocker coreLocker(gCoreHeapsLock);
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(); CoreEntry* other = gCoreHighLoadHeap->PeekMinimum();
return newCore != core; if (other == NULL)
other = gCoreHighLoadHeap->PeekMaximum();
return coreEntry->fLoad - other->fLoad >= kLoadDifference / 2;
} }
CoreEntry* other = gCoreHighLoadHeap->PeekMinimum(); return choose_small_task_core() != core;
if (other == NULL)
return false;
return coreEntry->fLoad - other->fLoad >= kLoadDifference / 2;
} }