mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
sched/pelt: Check that *_avg are null when *_sum are
Check that we never break the rule that pelt's avg values are null if pelt's sum are. Signed-off-by: Vincent Guittot <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Dietmar Eggemann <[email protected]> Acked-by: Odin Ugedal <[email protected]> Link: https://lore.kernel.org/r/[email protected]
This commit is contained in:
1 parent
0159bb020c
commit
9e077b52d8
1 file changed
+9
@@ -8026,6 +8026,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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user