lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181214082741.8507-1-benjamin.bouvier@nokia.com>
Date:   Fri, 14 Dec 2018 10:27:41 +0200
From:   Benjamin Bouvier <benjamin.bouvier@...ia.com>
To:     <mingo@...hat.com>, <peterz@...radead.org>
CC:     <rostedt@...dmis.org>, <u.kleine-koenig@...gutronix.de>,
        <bigeasy@...utronix.de>, <pkondeti@...eaurora.org>,
        <alexander.sverdlin@...ia.com>, <linux-kernel@...r.kernel.org>,
        Benjamin Bouvier <benjamin.bouvier@...ia.com>
Subject: [PATCH] sched/debug: Add tracepoint for RT throttling

As there is currently no information on which RT task is throttled, add a
new tracepoint for debug purpose. By the way improve printk debugging
message by adding task name, pid and cpu for which the throttle has been
executed.

Signed-off-by: Benjamin Bouvier <benjamin.bouvier@...ia.com>
---
 include/trace/events/sched.h | 27 +++++++++++++++++++++++++++
 kernel/sched/rt.c            |  6 +++++-
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 9a4bdfadab07..09d3f7566f0a 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -587,6 +587,33 @@ TRACE_EVENT(sched_wake_idle_without_ipi,
 
 	TP_printk("cpu=%d", __entry->cpu)
 );
+
+/*
+ * Tracepoint for RT throttling task.
+ */
+TRACE_EVENT(sched_rt_throttling,
+
+	TP_PROTO(struct task_struct *tsk, int cpu),
+
+	TP_ARGS(tsk, cpu),
+
+	TP_STRUCT__entry(
+		__array(char,	comm,	TASK_COMM_LEN)
+		__field(pid_t,	pid)
+		__field(int,	cpu)
+	),
+
+	TP_fast_assign(
+		memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN);
+		__entry->pid	= tsk->pid;
+		__entry->cpu	= cpu;
+	),
+
+	TP_printk("comm=%s pid=%d cpu=%d",
+			__entry->comm, __entry->pid,
+			__entry->cpu)
+);
+
 #endif /* _TRACE_SCHED_H */
 
 /* This part must be outside protection */
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index a21ea6021929..1a0ee91c9e16 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -6,6 +6,7 @@
 #include "sched.h"
 
 #include "pelt.h"
+#include <trace/events/sched.h>
 
 int sched_rr_timeslice = RR_TIMESLICE;
 int sysctl_sched_rr_timeslice = (MSEC_PER_SEC / HZ) * RR_TIMESLICE;
@@ -928,7 +929,10 @@ static int sched_rt_runtime_exceeded(struct rt_rq *rt_rq)
 		 */
 		if (likely(rt_b->rt_runtime)) {
 			rt_rq->rt_throttled = 1;
-			printk_deferred_once("sched: RT throttling activated\n");
+			printk_deferred_once(
+				"sched: RT throttling activated for task pid %d (%s) on cpu:%d\n",
+				rt_rq->rq->curr->pid, rt_rq->rq->curr->comm, rt_rq->rq->cpu);
+			trace_sched_rt_throttling(rt_rq->rq->curr, rt_rq->rq->cpu);
 		} else {
 			/*
 			 * In case we did anyway, make it go away,
-- 
2.10.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ