From 490b1d23cc0c905b1cfb722ece7291a6d3a0f87e Mon Sep 17 00:00:00 2001 From: Srivatsa Vaddagiri Date: Tue, 29 Apr 2014 08:56:13 -0700 Subject: [PATCH] sched: window-stats: Do not account wait time Task load statistics are used for two purposes : cpu frequency management and placement. Task's load can't be accurately judged by its wait time. For ex: a task could have waited for 10ms and when given opportunity to run, could just execute for 1ms. Accounting for 11ms as task's demand could be over-stating its needs in this example. For now, remove wait time from task demand and instead let task load be derived from its actual exec time. This may need to become a tunable feature. Change-Id: I47e94c444c6b44c3b0810347287d50f1ee685038 Signed-off-by: Srivatsa Vaddagiri --- kernel/sched/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 53f7e3293a7e..69b521584176 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1532,7 +1532,7 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu) perf_event_task_migrate(p); if (p->state == TASK_RUNNING) - update_task_ravg(p, task_rq(p), 1); + update_task_ravg(p, task_rq(p), 0); } __set_task_cpu(p, new_cpu); @@ -3321,7 +3321,7 @@ pick_next_task(struct rq *rq, struct task_struct *prev) if (unlikely(!p)) p = idle_sched_class.pick_next_task(rq, prev); - update_task_ravg(p, rq, 1); + update_task_ravg(p, rq, 0); return p; } @@ -3331,7 +3331,7 @@ again: if (p) { if (unlikely(p == RETRY_TASK)) goto again; - update_task_ravg(p, rq, 1); + update_task_ravg(p, rq, 0); return p; } }