All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/pelt: check that *_avg are null when *_sum are
@ 2021-06-01 15:53 Vincent Guittot
  2021-06-02  6:45   ` [LTP] " kernel test robot
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Vincent Guittot @ 2021-06-01 15:53 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, dietmar.eggemann, rostedt, bsegall,
	mgorman, bristot, linux-kernel
  Cc: odin, Vincent Guittot

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;
 }
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-06-18  8:46 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01 15:53 [PATCH] sched/pelt: check that *_avg are null when *_sum are Vincent Guittot
2021-06-02  6:45 ` [sched/pelt] e906550aca: WARNING:at_kernel/sched/fair.c:#update_blocked_averages kernel test robot
2021-06-02  6:45   ` kernel test robot
2021-06-02  6:45   ` [LTP] " kernel test robot
2021-06-03 10:50   ` Dietmar Eggemann
2021-06-03 10:50     ` Dietmar Eggemann
2021-06-03 10:50     ` [LTP] " Dietmar Eggemann
2021-06-03 10:59     ` Vincent Guittot
2021-06-03 10:59       ` Vincent Guittot
2021-06-03 10:59       ` [LTP] " Vincent Guittot
2021-06-03 10:42 ` [PATCH] sched/pelt: check that *_avg are null when *_sum are Dietmar Eggemann
2021-06-03 11:06 ` Odin Ugedal
2021-06-03 12:47   ` Vincent Guittot
2021-06-03 14:32     ` Odin Ugedal
2021-06-18  8:46 ` [tip: sched/core] sched/pelt: Check " tip-bot2 for Vincent Guittot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.