aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorVincent Guittot <vincent.guittot@linaro.org>2015-02-27 10:54:04 -0500
committerIngo Molnar <mingo@kernel.org>2015-03-27 04:35:57 -0400
commit36ee28e45df50c2c8624b978335516e42d84ae1f (patch)
tree29c1060b971136642a02a9d9ef759635ed0ff782 /include/linux/sched.h
parentb6366f048e0caff28af5335b7af2031266e1b06b (diff)
sched: Add sched_avg::utilization_avg_contrib
Add new statistics which reflect the average time a task is running on the CPU and the sum of these running time of the tasks on a runqueue. The latter is named utilization_load_avg. This patch is based on the usage metric that was proposed in the 1st versions of the per-entity load tracking patchset by Paul Turner <pjt@google.com> but that has be removed afterwards. This version differs from the original one in the sense that it's not linked to task_group. The rq's utilization_load_avg will be used to check if a rq is overloaded or not instead of trying to compute how many tasks a group of CPUs can handle. Rename runnable_avg_period into avg_period as it is now used with both runnable_avg_sum and running_avg_sum. Add some descriptions of the variables to explain their differences. Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Morten Rasmussen <morten.rasmussen@arm.com> Cc: Paul Turner <pjt@google.com> Cc: Ben Segall <bsegall@google.com> Cc: Ben Segall <bsegall@google.com> Cc: Morten.Rasmussen@arm.com Cc: Paul Turner <pjt@google.com> Cc: dietmar.eggemann@arm.com Cc: efault@gmx.de Cc: kamalesh@linux.vnet.ibm.com Cc: linaro-kernel@lists.linaro.org Cc: nicolas.pitre@linaro.org Cc: preeti@linux.vnet.ibm.com Cc: riel@redhat.com Link: http://lkml.kernel.org/r/1425052454-25797-2-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 6d77432e14ff..fdca05c5f812 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1115,15 +1115,28 @@ struct load_weight {
1115}; 1115};
1116 1116
1117struct sched_avg { 1117struct sched_avg {
1118 u64 last_runnable_update;
1119 s64 decay_count;
1120 /*
1121 * utilization_avg_contrib describes the amount of time that a
1122 * sched_entity is running on a CPU. It is based on running_avg_sum
1123 * and is scaled in the range [0..SCHED_LOAD_SCALE].
1124 * load_avg_contrib described the amount of time that a sched_entity
1125 * is runnable on a rq. It is based on both runnable_avg_sum and the
1126 * weight of the task.
1127 */
1128 unsigned long load_avg_contrib, utilization_avg_contrib;
1118 /* 1129 /*
1119 * These sums represent an infinite geometric series and so are bound 1130 * These sums represent an infinite geometric series and so are bound
1120 * above by 1024/(1-y). Thus we only need a u32 to store them for all 1131 * above by 1024/(1-y). Thus we only need a u32 to store them for all
1121 * choices of y < 1-2^(-32)*1024. 1132 * choices of y < 1-2^(-32)*1024.
1133 * running_avg_sum reflects the time that the sched_entity is
1134 * effectively running on the CPU.
1135 * runnable_avg_sum represents the amount of time a sched_entity is on
1136 * a runqueue which includes the running time that is monitored by
1137 * running_avg_sum.
1122 */ 1138 */
1123 u32 runnable_avg_sum, runnable_avg_period; 1139 u32 runnable_avg_sum, avg_period, running_avg_sum;
1124 u64 last_runnable_update;
1125 s64 decay_count;
1126 unsigned long load_avg_contrib;
1127}; 1140};
1128 1141
1129#ifdef CONFIG_SCHEDSTATS 1142#ifdef CONFIG_SCHEDSTATS