lkml.org 
[lkml]   [2013]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] sched: fix wrong rq's runnable_avg update with rt task
From
On 8 February 2013 15:46, Steven Rostedt <rostedt@goodmis.org> wrote:
> On Fri, 2013-02-08 at 12:11 +0100, Vincent Guittot wrote:
>> When a RT task is scheduled on an idle CPU, the update of the rq's load is
>> not done because CFS's functions are not called. Then, the idle_balance,
>> which is called just before entering the idle function, updates the
>> rq's load and makes the assumption that the elapsed time since the last
>> update, was only running time.
>>
>> The rq's load of a CPU that only runs a periodic RT task, is close to
>> LOAD_AVG_MAX whatever the running duration of the RT task is.
>>
>> A new idle_exit function is called when the prev task is the idle function
>> so the elapsed time will be accounted as idle time in the rq's load.
>>
>> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
>> ---
>> kernel/sched/core.c | 3 +++
>> kernel/sched/fair.c | 10 ++++++++++
>> kernel/sched/sched.h | 5 +++++
>> 3 files changed, 18 insertions(+)
>>
>> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
>> index 26058d0..592e06c 100644
>> --- a/kernel/sched/core.c
>> +++ b/kernel/sched/core.c
>> @@ -2927,6 +2927,9 @@ need_resched:
>>
>> pre_schedule(rq, prev);
>>
>> + if (unlikely(prev == rq->idle))
>> + idle_exit(cpu, rq);
>> +
>
> Let's get rid of the added junk in the core code that should be isolated
> in the idle code.
>

i agree

> I posted these patches before, and I'm about to post again:
>
> https://lkml.org/lkml/2012/12/21/378
> https://lkml.org/lkml/2012/12/21/377
>
> I'm working to clean these patches up today and post them again. Would
> working on top of these work for you?

yes for sure.
I will move that code in pre_schedule

Vincent

>
> -- Steve
>
>
>> if (unlikely(!rq->nr_running))
>> idle_balance(cpu, rq);
>>
>
>


\
 
 \ /
  Last update: 2013-02-08 16:43    [W:0.061 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site