From 1da76fd4cc60e12877a69ec685b00ff49bd7b34e Mon Sep 17 00:00:00 2001 From: Pawel Dziepak Date: Thu, 6 Feb 2014 02:50:07 +0100 Subject: [PATCH] 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. --- src/system/kernel/scheduler/scheduler_thread.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/system/kernel/scheduler/scheduler_thread.cpp b/src/system/kernel/scheduler/scheduler_thread.cpp index c5eed05bd3..25a332bed4 100644 --- a/src/system/kernel/scheduler/scheduler_thread.cpp +++ b/src/system/kernel/scheduler/scheduler_thread.cpp @@ -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; }