From: wen.yang@linux.dev
To: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Steven Rostedt <rostedt@goodmis.org>,
Mel Gorman <mgorman@suse.de>,
Valentin Schneider <vschneid@redhat.com>
Cc: Wen Yang <wen.yang@linux.dev>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Ben Segall <bsegall@google.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] sched/debug: add new tracepoints to track rt throttling
Date: Wed, 19 Nov 2025 00:05:25 +0800 [thread overview]
Message-ID: <20251118160525.1686985-1-wen.yang@linux.dev> (raw)
From: Wen Yang <wen.yang@linux.dev>
The new tracepoint allows for tracking RT throttling events at
the rt_rq level to identify RT processes that use a large amount
of CPU.
Signed-off-by: Wen Yang <wen.yang@linux.dev>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ben Segall <bsegall@google.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Valentin Schneider <vschneid@redhat.com>
Cc: linux-kernel@vger.kernel.org
---
include/linux/sched.h | 1 +
include/trace/events/sched.h | 5 +++++
kernel/sched/rt.c | 1 +
3 files changed, 7 insertions(+)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 40a6027a2cfd..210cf5ce41be 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -78,6 +78,7 @@ struct reclaim_state;
struct robust_list_head;
struct root_domain;
struct rq;
+struct rt_rq;
struct sched_attr;
struct sched_dl_entity;
struct seq_file;
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 7b2645b50e78..9ec53bc98df9 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -896,6 +896,11 @@ DECLARE_TRACE(sched_set_need_resched,
TP_PROTO(struct task_struct *tsk, int cpu, int tif),
TP_ARGS(tsk, cpu, tif));
+DECLARE_TRACE(sched_rt_throttled,
+ TP_PROTO(struct rt_rq *rt_rq),
+ TP_ARGS(rt_rq));
+
+
#endif /* _TRACE_SCHED_H */
/* This part must be outside protection */
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index f1867fe8e5c5..c04762a51ff0 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -884,6 +884,7 @@ static int sched_rt_runtime_exceeded(struct rt_rq *rt_rq)
*/
if (likely(rt_b->rt_runtime)) {
rt_rq->rt_throttled = 1;
+ trace_sched_rt_throttled_tp(rt_rq);
printk_deferred_once("sched: RT throttling activated\n");
} else {
/*
--
2.25.1
reply other threads:[~2025-11-18 16:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20251118160525.1686985-1-wen.yang@linux.dev \
--to=wen.yang@linux.dev \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
/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