summaryrefslogtreecommitdiffstats
path: root/kernel/sched/cpufreq_schedutil.c
diff options
context:
space:
mode:
authorVincent Guittot <vincent.guittot@linaro.org>2018-07-19 14:00:06 +0200
committerIngo Molnar <mingo@kernel.org>2018-07-25 11:41:05 +0200
commit2e62c4743adc4c7bfcbc1f45118fc7bec58cf30a (patch)
treeab27fa04b39f5636b852e243a3f0581f65af4dc3 /kernel/sched/cpufreq_schedutil.c
parentMerge branch 'sched/urgent' into sched/core, to pick up fixes (diff)
downloadlinux-2e62c4743adc4c7bfcbc1f45118fc7bec58cf30a.tar.xz
linux-2e62c4743adc4c7bfcbc1f45118fc7bec58cf30a.zip
sched/fair: Remove #ifdefs from scale_rt_capacity()
Reuse cpu_util_irq() that has been defined for schedutil and set irq util to 0 when !CONFIG_IRQ_TIME_ACCOUNTING. But the compiler is not able to optimize the sequence (at least with aarch64 GCC 7.2.1): free *= (max - irq); free /= max; when irq is fixed to 0 Add a new inline function scale_irq_capacity() that will scale utilization when irq is accounted. Reuse this funciton in schedutil which applies similar formula. Suggested-by: Ingo Molnar <mingo@redhat.com> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: rjw@rjwysocki.net Link: http://lkml.kernel.org/r/1532001606-6689-1-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/cpufreq_schedutil.c')
-rw-r--r--kernel/sched/cpufreq_schedutil.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index 97dcd4472a0e..3fffad3bc8a8 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -247,8 +247,7 @@ static unsigned long sugov_get_util(struct sugov_cpu *sg_cpu)
* U' = irq + ------- * U
* max
*/
- util *= (max - irq);
- util /= max;
+ util = scale_irq_capacity(util, irq, max);
util += irq;
/*