sched/rt: Add Kconfig option to enable panicking for RT throttling
authorMatt Wagantall <mattw@codeaurora.org>
Thu, 19 Jun 2014 21:23:33 +0000 (14:23 -0700)
committerAmit Pundir <amit.pundir@linaro.org>
Wed, 14 Sep 2016 09:32:22 +0000 (15:02 +0530)
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>
kernel/sched/rt.c
lib/Kconfig.debug

index 2b9121ea91bf63306fb0ab8ab183cb9dffc98206..8a16cba968c43c981b0e2671a5e1e2d6cc8e341a 100644 (file)
@@ -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)
index fc9f2adc0c9b26b830e0e572c01602c70d871724..63d14d9b51d889dceffc1492d4e72b220fae47cc 100644 (file)
@@ -867,6 +867,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