summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Wagantall <mattw@codeaurora.org>2014-06-19 14:23:33 -0700
committerJohn Stultz <john.stultz@linaro.org>2016-08-11 14:26:55 -0700
commit2a4445395f1be46db1200e1329fae06d034675e5 (patch)
tree1ec54e937dcc59cfc863e2a7b3049fc208480a89
parent989f33f789a85cc53f4c3f75e31ddfce65c6d873 (diff)
sched/rt: Add Kconfig option to enable panicking for RT throttling
This may be useful for detecting and debugging RT throttling issues. Change-Id: I5807a897d11997d76421c1fcaa2918aad988c6c9 Signed-off-by: Matt Wagantall <mattw@codeaurora.org> [rameezmustafa@codeaurora.org]: Port to msm-3.18] Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org> [jstultz: forwardported to 4.4] Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r--kernel/sched/rt.c9
-rw-r--r--lib/Kconfig.debug9
2 files changed, 18 insertions, 0 deletions
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 2b9121ea91bf..8a16cba968c4 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -924,7 +924,16 @@ static void dump_throttled_rt_tasks(struct rt_rq *rt_rq)
idx = find_next_bit(array->bitmap, MAX_RT_PRIO, idx + 1);
}
out:
+#ifdef CONFIG_PANIC_ON_RT_THROTTLING
+ /*
+ * Use pr_err() in the BUG() case since printk_sched() will
+ * not get flushed and deadlock is not a concern.
+ */
+ pr_err("%s", buf);
+ BUG();
+#else
printk_deferred("%s", buf);
+#endif
}
static int sched_rt_runtime_exceeded(struct rt_rq *rt_rq)
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 8c15b29d5adc..07ccfa681577 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -855,6 +855,15 @@ config SCHED_INFO
bool
default n
+config PANIC_ON_RT_THROTTLING
+ bool "Panic on RT throttling"
+ help
+ Say Y here to enable the kernel to panic when a realtime
+ runqueue is throttled. This may be useful for detecting
+ and debugging RT throttling issues.
+
+ Say N if unsure.
+
config SCHEDSTATS
bool "Collect scheduler statistics"
depends on DEBUG_KERNEL && PROC_FS