sched: Aggregate load contributed by task entities on parenting cfs_rq

For a given task t, we can compute its contribution to load as:

  task_load(t) = runnable_avg(t) * weight(t)

On a parenting cfs_rq we can then aggregate:

  runnable_load(cfs_rq) = \Sum task_load(t), for all runnable children t

Maintain this bottom up, with task entities adding their contributed load to
the parenting cfs_rq sum.  When a task entity's load changes we add the same
delta to the maintained sum.

Signed-off-by: Paul Turner <pjt@google.com>
Reviewed-by: Ben Segall <bsegall@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20120823141506.514678907@google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Paul Turner
2012-10-04 13:18:30 +02:00
committed by Ingo Molnar
parent 18bf2805d9
commit 2dac754e10
4 changed files with 60 additions and 5 deletions

View File

@@ -1103,6 +1103,7 @@ struct sched_avg {
*/
u32 runnable_avg_sum, runnable_avg_period;
u64 last_runnable_update;
unsigned long load_avg_contrib;
};
#ifdef CONFIG_SCHEDSTATS