aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@intel.com>2013-06-19 22:18:53 -0400
committerIngo Molnar <mingo@kernel.org>2013-06-27 04:07:38 -0400
commit72a4cf20cb71a327c636c7042fdacc25abffc87c (patch)
tree55679cadceb7ddf931f0c56a65e8eb031acd769d /kernel/sched
parenta003a25b227d59ded9197ced109517f037d01c27 (diff)
sched: Change cfs_rq load avg to unsigned long
Since the 'u64 runnable_load_avg, blocked_load_avg' in cfs_rq struct are smaller than 'unsigned long' cfs_rq->load.weight. We don't need u64 vaiables to describe them. unsigned long is more efficient and convenience. Signed-off-by: Alex Shi <alex.shi@intel.com> Reviewed-by: Paul Turner <pjt@google.com> Tested-by: Vincent Guittot <vincent.guittot@linaro.org> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1371694737-29336-10-git-send-email-alex.shi@intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/debug.c4
-rw-r--r--kernel/sched/fair.c7
-rw-r--r--kernel/sched/sched.h2
3 files changed, 5 insertions, 8 deletions
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 75024a673520..160afdc5cdff 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -211,9 +211,9 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
211 SEQ_printf(m, " .%-30s: %ld\n", "load", cfs_rq->load.weight); 211 SEQ_printf(m, " .%-30s: %ld\n", "load", cfs_rq->load.weight);
212#ifdef CONFIG_FAIR_GROUP_SCHED 212#ifdef CONFIG_FAIR_GROUP_SCHED
213#ifdef CONFIG_SMP 213#ifdef CONFIG_SMP
214 SEQ_printf(m, " .%-30s: %lld\n", "runnable_load_avg", 214 SEQ_printf(m, " .%-30s: %ld\n", "runnable_load_avg",
215 cfs_rq->runnable_load_avg); 215 cfs_rq->runnable_load_avg);
216 SEQ_printf(m, " .%-30s: %lld\n", "blocked_load_avg", 216 SEQ_printf(m, " .%-30s: %ld\n", "blocked_load_avg",
217 cfs_rq->blocked_load_avg); 217 cfs_rq->blocked_load_avg);
218 SEQ_printf(m, " .%-30s: %lld\n", "tg_load_avg", 218 SEQ_printf(m, " .%-30s: %lld\n", "tg_load_avg",
219 (unsigned long long)atomic64_read(&cfs_rq->tg->load_avg)); 219 (unsigned long long)atomic64_read(&cfs_rq->tg->load_avg));
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 7948bb825985..f19772de1b1c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4181,12 +4181,9 @@ static int tg_load_down(struct task_group *tg, void *data)
4181 if (!tg->parent) { 4181 if (!tg->parent) {
4182 load = cpu_rq(cpu)->avg.load_avg_contrib; 4182 load = cpu_rq(cpu)->avg.load_avg_contrib;
4183 } else { 4183 } else {
4184 unsigned long tmp_rla;
4185 tmp_rla = tg->parent->cfs_rq[cpu]->runnable_load_avg + 1;
4186
4187 load = tg->parent->cfs_rq[cpu]->h_load; 4184 load = tg->parent->cfs_rq[cpu]->h_load;
4188 load *= tg->se[cpu]->avg.load_avg_contrib; 4185 load = div64_ul(load * tg->se[cpu]->avg.load_avg_contrib,
4189 load /= tmp_rla; 4186 tg->parent->cfs_rq[cpu]->runnable_load_avg + 1);
4190 } 4187 }
4191 4188
4192 tg->cfs_rq[cpu]->h_load = load; 4189 tg->cfs_rq[cpu]->h_load = load;
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 9c65d46504b1..9eb12d9edd35 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -277,7 +277,7 @@ struct cfs_rq {
277 * This allows for the description of both thread and group usage (in 277 * This allows for the description of both thread and group usage (in
278 * the FAIR_GROUP_SCHED case). 278 * the FAIR_GROUP_SCHED case).
279 */ 279 */
280 u64 runnable_load_avg, blocked_load_avg; 280 unsigned long runnable_load_avg, blocked_load_avg;
281 atomic64_t decay_counter, removed_load; 281 atomic64_t decay_counter, removed_load;
282 u64 last_decay; 282 u64 last_decay;
283 283