diff options
author | Paul Turner <pjt@google.com> | 2012-10-04 07:18:30 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-10-24 04:27:21 -0400 |
commit | 2dac754e10a5d41d94d2d2365c0345d4f215a266 (patch) | |
tree | 4016ab214b5b51b2be5c40ab2fdc9832c8aca870 /kernel/sched/sched.h | |
parent | 18bf2805d9b30cb823d4919b42cd230f59c7ce1f (diff) |
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>
Diffstat (limited to 'kernel/sched/sched.h')
-rw-r--r-- | kernel/sched/sched.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 14b571968713..e6539736af58 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h | |||
@@ -222,6 +222,15 @@ struct cfs_rq { | |||
222 | unsigned int nr_spread_over; | 222 | unsigned int nr_spread_over; |
223 | #endif | 223 | #endif |
224 | 224 | ||
225 | #ifdef CONFIG_SMP | ||
226 | /* | ||
227 | * CFS Load tracking | ||
228 | * Under CFS, load is tracked on a per-entity basis and aggregated up. | ||
229 | * This allows for the description of both thread and group usage (in | ||
230 | * the FAIR_GROUP_SCHED case). | ||
231 | */ | ||
232 | u64 runnable_load_avg; | ||
233 | #endif | ||
225 | #ifdef CONFIG_FAIR_GROUP_SCHED | 234 | #ifdef CONFIG_FAIR_GROUP_SCHED |
226 | struct rq *rq; /* cpu runqueue to which this cfs_rq is attached */ | 235 | struct rq *rq; /* cpu runqueue to which this cfs_rq is attached */ |
227 | 236 | ||
@@ -1214,4 +1223,3 @@ static inline u64 irq_time_read(int cpu) | |||
1214 | } | 1223 | } |
1215 | #endif /* CONFIG_64BIT */ | 1224 | #endif /* CONFIG_64BIT */ |
1216 | #endif /* CONFIG_IRQ_TIME_ACCOUNTING */ | 1225 | #endif /* CONFIG_IRQ_TIME_ACCOUNTING */ |
1217 | |||