scheduler: Inherit estimated load, do not inherit assigned core

The initial core assignment has to be done without any knowledge about
the thread behaviour. Moreover, short lived tasks may spent most of their
time executing on that initial core. This patch attempts to improve the
qualiti of that initial decision.
This commit is contained in:
Pawel Dziepak 2014-02-06 02:50:07 +01:00
parent 667b23ddc2
commit 1da76fd4cc

View File

@ -30,8 +30,6 @@ ThreadData::_InitBase()
fLastMeasureAvailableTime = 0;
fMeasureAvailableTime = 0;
fNeededLoad = 0;
fWentSleep = 0;
fWentSleepActive = 0;
@ -95,11 +93,11 @@ void
ThreadData::Init()
{
_InitBase();
fCore = NULL;
Thread* currentThread = thread_get_current_thread();
ThreadData* currentThreadData = currentThread->scheduler_data;
fCore = currentThreadData->fCore;
fLoadMeasurementEpoch = fCore->LoadMeasurementEpoch() - 1;
fNeededLoad = currentThreadData->fNeededLoad;
if (!IsRealTime()) {
fPriorityPenalty = std::min(currentThreadData->fPriorityPenalty,
@ -118,6 +116,7 @@ ThreadData::Init(CoreEntry* core)
fCore = core;
fReady = true;
fNeededLoad = 0;
}