sched: avoid unnecessary multiplication and division
Avoid unnecessary multiplication and division when load scaling factor is 1024. Change-Id: If3cb63a77feaf49cc69ddec7f41cc3c1cabbfc5a Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
This commit is contained in:
parent
91a8710235
commit
b2e60dbe08
1 changed files with 4 additions and 2 deletions
|
@ -1034,8 +1034,10 @@ static inline u64 scale_load_to_cpu(u64 task_load, int cpu)
|
|||
{
|
||||
struct rq *rq = cpu_rq(cpu);
|
||||
|
||||
task_load *= (u64)rq->load_scale_factor;
|
||||
task_load /= 1024;
|
||||
if (rq->load_scale_factor != 1024) {
|
||||
task_load *= (u64)rq->load_scale_factor;
|
||||
task_load /= 1024;
|
||||
}
|
||||
|
||||
return task_load;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue