lkml.org 
[lkml]   [2021]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] sched/pelt: check that *_avg are null when *_sum are
From
Date
On 01/06/2021 17:53, Vincent Guittot wrote:
> Check that we never break the rule that pelt's avg values are null if
> pelt's sum are.
>
> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> ---
>
> This is what I used for patch 20210601085832.12626-1-vincent.guittot@linaro.org
>
> kernel/sched/fair.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index a2c30e52de76..c17feadeafcc 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -8021,6 +8021,15 @@ static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq)
> if (cfs_rq->avg.runnable_sum)
> return false;
>
> + /*
> + * _avg must be null when _sum are null because _avg = _sum / divider
> + * Make sure that rounding and/or propagation of PELT values never
> + * break this.
> + */
> + SCHED_WARN_ON(cfs_rq->avg.load_avg ||
> + cfs_rq->avg.util_avg ||
> + cfs_rq->avg.runnable_avg);
> +
> return true;
> }

Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>

\
 
 \ /
  Last update: 2021-06-03 12:43    [W:0.084 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site