summaryrefslogtreecommitdiff
path: root/kernel/sched/pelt.h
diff options
context:
space:
mode:
authorVincent Guittot <vincent.guittot@linaro.org>2020-06-12 18:47:03 +0300
committerPeter Zijlstra <peterz@infradead.org>2020-06-15 15:10:06 +0300
commit87e867b4269f29dac8190bca13912d08163a277f (patch)
treeb41a7a09c81a71c0985f8fc820b903fbc836b29c /kernel/sched/pelt.h
parentc49694173da004b1b16082f82f28bd625415fbb2 (diff)
downloadlinux-87e867b4269f29dac8190bca13912d08163a277f.tar.xz
sched/pelt: Cleanup PELT divider
Factorize in a single place the calculation of the divider to be used to to compute *_avg from *_sum value Suggested-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20200612154703.23555-1-vincent.guittot@linaro.org
Diffstat (limited to 'kernel/sched/pelt.h')
-rw-r--r--kernel/sched/pelt.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/sched/pelt.h b/kernel/sched/pelt.h
index eb034d9f024d..795e43e02afc 100644
--- a/kernel/sched/pelt.h
+++ b/kernel/sched/pelt.h
@@ -37,6 +37,11 @@ update_irq_load_avg(struct rq *rq, u64 running)
}
#endif
+static inline u32 get_pelt_divider(struct sched_avg *avg)
+{
+ return LOAD_AVG_MAX - 1024 + avg->period_contrib;
+}
+
/*
* When a task is dequeued, its estimated utilization should not be update if
* its util_avg has not been updated at least once.