sched/dl: Add dl_rq utilization tracking
Similarly to what happens with RT tasks, CFS tasks can be preempted by DL tasks and the CFS's utilization might no longer describes the real utilization level. Current DL bandwidth reflects the requirements to meet deadline when tasks are enqueued but not the current utilization of the DL sched class. We track DL class utilization to estimate the system utilization. Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Morten.Rasmussen@arm.com Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: claudio@evidence.eu.com Cc: daniel.lezcano@linaro.org Cc: dietmar.eggemann@arm.com Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: luca.abeni@santannapisa.it Cc: patrick.bellasi@arm.com Cc: quentin.perret@arm.com Cc: rjw@rjwysocki.net Cc: valentin.schneider@arm.com Cc: viresh.kumar@linaro.org Link: http://lkml.kernel.org/r/1530200714-4504-5-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:

committed by
Ingo Molnar

parent
3ae117c6cd
commit
3727e0e163
@@ -7290,11 +7290,14 @@ static inline bool cfs_rq_has_blocked(struct cfs_rq *cfs_rq)
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool rt_rq_has_blocked(struct rq *rq)
|
||||
static inline bool others_rqs_have_blocked(struct rq *rq)
|
||||
{
|
||||
if (READ_ONCE(rq->avg_rt.util_avg))
|
||||
return true;
|
||||
|
||||
if (READ_ONCE(rq->avg_dl.util_avg))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -7358,8 +7361,9 @@ static void update_blocked_averages(int cpu)
|
||||
done = false;
|
||||
}
|
||||
update_rt_rq_load_avg(rq_clock_task(rq), rq, 0);
|
||||
update_dl_rq_load_avg(rq_clock_task(rq), rq, 0);
|
||||
/* Don't need periodic decay once load/util_avg are null */
|
||||
if (rt_rq_has_blocked(rq))
|
||||
if (others_rqs_have_blocked(rq))
|
||||
done = false;
|
||||
|
||||
#ifdef CONFIG_NO_HZ_COMMON
|
||||
@@ -7427,9 +7431,10 @@ static inline void update_blocked_averages(int cpu)
|
||||
update_rq_clock(rq);
|
||||
update_cfs_rq_load_avg(cfs_rq_clock_task(cfs_rq), cfs_rq);
|
||||
update_rt_rq_load_avg(rq_clock_task(rq), rq, 0);
|
||||
update_dl_rq_load_avg(rq_clock_task(rq), rq, 0);
|
||||
#ifdef CONFIG_NO_HZ_COMMON
|
||||
rq->last_blocked_load_update_tick = jiffies;
|
||||
if (!cfs_rq_has_blocked(cfs_rq) && !rt_rq_has_blocked(rq))
|
||||
if (!cfs_rq_has_blocked(cfs_rq) && !others_rqs_have_blocked(rq))
|
||||
rq->has_blocked_load = 0;
|
||||
#endif
|
||||
rq_unlock_irqrestore(rq, &rf);
|
||||
|
Reference in New Issue
Block a user