diff options
author | Vincent Guittot | 2020-06-12 17:47:03 +0200 |
---|---|---|
committer | Peter Zijlstra | 2020-06-15 14:10:06 +0200 |
commit | 87e867b4269f29dac8190bca13912d08163a277f (patch) | |
tree | b41a7a09c81a71c0985f8fc820b903fbc836b29c /kernel/sched/pelt.h | |
parent | c49694173da004b1b16082f82f28bd625415fbb2 (diff) |
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.h | 5 |
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. |