mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qais Yousef <qais.yousef@arm.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org,
	Pavankumar Kondeti <pkondeti@codeaurora.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Uwe Kleine-Konig <u.kleine-koenig@pengutronix.de>,
	Qais Yousef <qais.yousef@arm.com>
Subject: [PATCH 6/7] sched: Add sched_overutilized tracepoint
Date: Sun,  5 May 2019 12:57:31 +0100	[thread overview]
Message-ID: <20190505115732.9844-7-qais.yousef@arm.com> (raw)
In-Reply-To: <20190505115732.9844-1-qais.yousef@arm.com>

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>
---
 include/trace/events/sched.h | 4 ++++
 kernel/sched/fair.c          | 7 ++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 0933c08cfc7e..d27733d9aed6 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -600,6 +600,10 @@ DECLARE_TRACE(sched_load_se,
 	TP_PROTO(int cpu, const char *path, struct sched_entity *se),
 	TP_ARGS(cpu, path, se));
 
+DECLARE_TRACE(sched_overutilized,
+	TP_PROTO(int overutilized),
+	TP_ARGS(overutilized));
+
 #endif /* _TRACE_SCHED_H */
 
 /* This part must be outside protection */
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 3fd306079b57..75403918e158 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4965,8 +4965,10 @@ static inline bool cpu_overutilized(int cpu)
 
 static inline void update_overutilized_status(struct rq *rq)
 {
-	if (!READ_ONCE(rq->rd->overutilized) && cpu_overutilized(rq->cpu))
+	if (!READ_ONCE(rq->rd->overutilized) && cpu_overutilized(rq->cpu)) {
 		WRITE_ONCE(rq->rd->overutilized, SG_OVERUTILIZED);
+		trace_sched_overutilized(1);
+	}
 }
 #else
 static inline void update_overutilized_status(struct rq *rq) { }
@@ -8330,8 +8332,11 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd
 
 		/* Update over-utilization (tipping point, U >= 0) indicator */
 		WRITE_ONCE(rd->overutilized, sg_status & SG_OVERUTILIZED);
+
+		trace_sched_overutilized(!!(sg_status & SG_OVERUTILIZED));
 	} else if (sg_status & SG_OVERUTILIZED) {
 		WRITE_ONCE(env->dst_rq->rd->overutilized, SG_OVERUTILIZED);
+		trace_sched_overutilized(1);
 	}
 }
 
-- 
2.17.1


  parent reply	other threads:[~2019-05-05 11:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-05 11:57 [PATCH 0/7] Add new tracepoints required for EAS testing Qais Yousef
2019-05-05 11:57 ` [PATCH 1/7] sched: autogroup: Make autogroup_path() always available Qais Yousef
2019-05-05 11:57 ` [PATCH 2/7] sched: fair: move helper functions into fair.h Qais Yousef
2019-05-05 11:57 ` [PATCH 3/7] sched: fair.h: add a new cfs_rq_tg_path() Qais Yousef
2019-05-05 11:57 ` [PATCH 4/7] sched: Add sched_load_rq tracepoint Qais Yousef
2019-05-06  9:08   ` Peter Zijlstra
2019-05-06  9:18     ` Peter Zijlstra
2019-05-08 13:38       ` Qais Yousef
2019-05-06 13:52     ` Steven Rostedt
2019-05-06 14:42       ` Qais Yousef
2019-05-06 14:46         ` Steven Rostedt
2019-05-06 15:33           ` Qais Yousef
2019-05-06 16:01             ` Steven Rostedt
2019-05-06 17:23               ` Qais Yousef
2019-05-06 14:38     ` Qais Yousef
2019-05-10  8:51   ` Dietmar Eggemann
2019-05-10  9:14     ` Qais Yousef
2019-05-05 11:57 ` [PATCH 5/7] sched: Add sched_load_se tracepoint Qais Yousef
2019-05-05 11:57 ` Qais Yousef [this message]
2019-05-05 11:57 ` [PATCH 7/7] sched: export the newly added tracepoints Qais Yousef

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190505115732.9844-7-qais.yousef@arm.com \
    --to=qais.yousef@arm.com \
    --cc=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pkondeti@codeaurora.org \
    --cc=rostedt@goodmis.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®