Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sched/debug: Add sched_overutilized tracepoint

The new tracepoint allows us to track the changes in overutilized
status.

Overutilized status is associated with EAS. It indicates that the system
is in high performance state. EAS is disabled when the system is in this
state since there's not much energy savings while high performance tasks
are pushing the system to the limit and it's better to default to the
spreading behavior of the scheduler.

This tracepoint helps understanding and debugging the conditions under
which this happens.

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Pavankumar Kondeti <pkondeti@codeaurora.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Quentin Perret <quentin.perret@arm.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Uwe Kleine-Konig <u.kleine-koenig@pengutronix.de>
Link: https://lkml.kernel.org/r/20190604111459.2862-6-qais.yousef@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Qais Yousef and committed by
Ingo Molnar
f9f240f9 8de6242c

+12 -2
+4
include/trace/events/sched.h
··· 621 621 TP_PROTO(struct sched_entity *se), 622 622 TP_ARGS(se)); 623 623 624 + DECLARE_TRACE(sched_overutilized_tp, 625 + TP_PROTO(struct root_domain *rd, bool overutilized), 626 + TP_ARGS(rd, overutilized)); 627 + 624 628 #endif /* _TRACE_SCHED_H */ 625 629 626 630 /* This part must be outside protection */
+8 -2
kernel/sched/fair.c
··· 5181 5181 5182 5182 static inline void update_overutilized_status(struct rq *rq) 5183 5183 { 5184 - if (!READ_ONCE(rq->rd->overutilized) && cpu_overutilized(rq->cpu)) 5184 + if (!READ_ONCE(rq->rd->overutilized) && cpu_overutilized(rq->cpu)) { 5185 5185 WRITE_ONCE(rq->rd->overutilized, SG_OVERUTILIZED); 5186 + trace_sched_overutilized_tp(rq->rd, SG_OVERUTILIZED); 5187 + } 5186 5188 } 5187 5189 #else 5188 5190 static inline void update_overutilized_status(struct rq *rq) { } ··· 8216 8214 8217 8215 /* Update over-utilization (tipping point, U >= 0) indicator */ 8218 8216 WRITE_ONCE(rd->overutilized, sg_status & SG_OVERUTILIZED); 8217 + trace_sched_overutilized_tp(rd, sg_status & SG_OVERUTILIZED); 8219 8218 } else if (sg_status & SG_OVERUTILIZED) { 8220 - WRITE_ONCE(env->dst_rq->rd->overutilized, SG_OVERUTILIZED); 8219 + struct root_domain *rd = env->dst_rq->rd; 8220 + 8221 + WRITE_ONCE(rd->overutilized, SG_OVERUTILIZED); 8222 + trace_sched_overutilized_tp(rd, SG_OVERUTILIZED); 8221 8223 } 8222 8224 } 8223 8225