[RFC 38/60] cosched: Skip updates on non-CPU runqueues in cfs_rq_util_change()

From: Jan H. SchÃnherr
Date: Fri Sep 07 2018 - 17:48:43 EST


The function cfs_rq_util_change() notifies frequency governors of
utilization changes, so that they can be scheduler driven. This is
coupled to per CPU runqueue statistics. So, don't do anything
when called for non-CPU runqueues.

Signed-off-by: Jan H. SchÃnherr <jschoenh@xxxxxxxxx>
---
kernel/sched/fair.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index a2945355f823..33e3f759eb99 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3015,7 +3015,16 @@ static inline void update_cfs_group(struct sched_entity *se)

static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq, int flags)
{
- struct rq *rq = rq_of(cfs_rq);
+ struct rq *rq = hrq_of(cfs_rq);
+
+#ifdef CONFIG_COSCHEDULING
+ /*
+ * This function is currently only well defined for per-CPU
+ * runqueues. Don't execute it for anything else.
+ */
+ if (rq->sdrq_data.level)
+ return;
+#endif

if (&rq->cfs == cfs_rq || (flags & SCHED_CPUFREQ_MIGRATION)) {
/*
--
2.9.3.1.gcba166c.dirty