diff options
author | Lucas De Marchi <lucas.de.marchi@gmail.com> | 2010-03-10 21:37:45 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-03-11 09:22:28 -0500 |
commit | 41acab8851a0408c1d5ad6c21a07456f88b54d40 (patch) | |
tree | 28b23b930571c1f6dfd5c4e8129a2a7ea2056307 /include | |
parent | 3d07467b7aa91623b31d7b5888a123a2c8c8e9cc (diff) |
sched: Implement group scheduler statistics in one struct
Put all statistic fields of sched_entity in one struct, sched_statistics,
and embed it into sched_entity.
This change allows to memset the sched_statistics to 0 when needed (for
instance when forking), avoiding bugs of non initialized fields.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1268275065-18542-1-git-send-email-lucas.de.marchi@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sched.h | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 4b1753f7e48e..8cc863d66477 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1127,36 +1127,8 @@ struct load_weight { | |||
1127 | unsigned long weight, inv_weight; | 1127 | unsigned long weight, inv_weight; |
1128 | }; | 1128 | }; |
1129 | 1129 | ||
1130 | /* | ||
1131 | * CFS stats for a schedulable entity (task, task-group etc) | ||
1132 | * | ||
1133 | * Current field usage histogram: | ||
1134 | * | ||
1135 | * 4 se->block_start | ||
1136 | * 4 se->run_node | ||
1137 | * 4 se->sleep_start | ||
1138 | * 6 se->load.weight | ||
1139 | */ | ||
1140 | struct sched_entity { | ||
1141 | struct load_weight load; /* for load-balancing */ | ||
1142 | struct rb_node run_node; | ||
1143 | struct list_head group_node; | ||
1144 | unsigned int on_rq; | ||
1145 | |||
1146 | u64 exec_start; | ||
1147 | u64 sum_exec_runtime; | ||
1148 | u64 vruntime; | ||
1149 | u64 prev_sum_exec_runtime; | ||
1150 | |||
1151 | u64 last_wakeup; | ||
1152 | u64 avg_overlap; | ||
1153 | |||
1154 | u64 nr_migrations; | ||
1155 | |||
1156 | u64 start_runtime; | ||
1157 | u64 avg_wakeup; | ||
1158 | |||
1159 | #ifdef CONFIG_SCHEDSTATS | 1130 | #ifdef CONFIG_SCHEDSTATS |
1131 | struct sched_statistics { | ||
1160 | u64 wait_start; | 1132 | u64 wait_start; |
1161 | u64 wait_max; | 1133 | u64 wait_max; |
1162 | u64 wait_count; | 1134 | u64 wait_count; |
@@ -1188,6 +1160,30 @@ struct sched_entity { | |||
1188 | u64 nr_wakeups_affine_attempts; | 1160 | u64 nr_wakeups_affine_attempts; |
1189 | u64 nr_wakeups_passive; | 1161 | u64 nr_wakeups_passive; |
1190 | u64 nr_wakeups_idle; | 1162 | u64 nr_wakeups_idle; |
1163 | }; | ||
1164 | #endif | ||
1165 | |||
1166 | struct sched_entity { | ||
1167 | struct load_weight load; /* for load-balancing */ | ||
1168 | struct rb_node run_node; | ||
1169 | struct list_head group_node; | ||
1170 | unsigned int on_rq; | ||
1171 | |||
1172 | u64 exec_start; | ||
1173 | u64 sum_exec_runtime; | ||
1174 | u64 vruntime; | ||
1175 | u64 prev_sum_exec_runtime; | ||
1176 | |||
1177 | u64 last_wakeup; | ||
1178 | u64 avg_overlap; | ||
1179 | |||
1180 | u64 nr_migrations; | ||
1181 | |||
1182 | u64 start_runtime; | ||
1183 | u64 avg_wakeup; | ||
1184 | |||
1185 | #ifdef CONFIG_SCHEDSTATS | ||
1186 | struct sched_statistics statistics; | ||
1191 | #endif | 1187 | #endif |
1192 | 1188 | ||
1193 | #ifdef CONFIG_FAIR_GROUP_SCHED | 1189 | #ifdef CONFIG_FAIR_GROUP_SCHED |