sched/fair: Rename scale() to cap_scale()

Rename scale() to cap_scale() to better reflect its purpose, it is
after all not a general purpose scale function, it has
SCHED_CAPACITY_SHIFT hardcoded in it.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Peter Zijlstra 2015-09-07 15:05:42 +02:00 committed by Ingo Molnar
parent 98d8fd8126
commit 54a21385fa
1 changed files with 7 additions and 7 deletions

View File

@ -2515,7 +2515,7 @@ static u32 __compute_runnable_contrib(u64 n)
return contrib + runnable_avg_yN_sum[n];
}
#define scale(v, s) ((v)*(s) >> SCHED_CAPACITY_SHIFT)
#define cap_scale(v, s) ((v)*(s) >> SCHED_CAPACITY_SHIFT)
/*
* We can represent the historical contribution to runnable average as the
@ -2588,7 +2588,7 @@ __update_load_avg(u64 now, int cpu, struct sched_avg *sa,
* period and accrue it.
*/
delta_w = 1024 - delta_w;
scaled_delta_w = scale(delta_w, scale_freq);
scaled_delta_w = cap_scale(delta_w, scale_freq);
if (weight) {
sa->load_sum += weight * scaled_delta_w;
if (cfs_rq) {
@ -2597,7 +2597,7 @@ __update_load_avg(u64 now, int cpu, struct sched_avg *sa,
}
}
if (running)
sa->util_sum += scale(scaled_delta_w, scale_cpu);
sa->util_sum += cap_scale(scaled_delta_w, scale_cpu);
delta -= delta_w;
@ -2614,25 +2614,25 @@ __update_load_avg(u64 now, int cpu, struct sched_avg *sa,
/* Efficiently calculate \sum (1..n_period) 1024*y^i */
contrib = __compute_runnable_contrib(periods);
contrib = scale(contrib, scale_freq);
contrib = cap_scale(contrib, scale_freq);
if (weight) {
sa->load_sum += weight * contrib;
if (cfs_rq)
cfs_rq->runnable_load_sum += weight * contrib;
}
if (running)
sa->util_sum += scale(contrib, scale_cpu);
sa->util_sum += cap_scale(contrib, scale_cpu);
}
/* Remainder of delta accrued against u_0` */
scaled_delta = scale(delta, scale_freq);
scaled_delta = cap_scale(delta, scale_freq);
if (weight) {
sa->load_sum += weight * scaled_delta;
if (cfs_rq)
cfs_rq->runnable_load_sum += weight * scaled_delta;
}
if (running)
sa->util_sum += scale(scaled_delta, scale_cpu);
sa->util_sum += cap_scale(scaled_delta, scale_cpu);
sa->period_contrib += delta;