aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Wagantall <mattw@codeaurora.org>2015-03-20 12:54:57 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-04-07 09:48:11 -0700
commit4933b84d1d40682ee7cb49afa092a69af409a01e (patch)
tree473da839628bbf2cf412f4357d420193cd0857af
parent7fba991e780577e29d7072cc7678fa7bf47b0a28 (diff)
downloadqcom-msm-v3.10-4933b84d1d40682ee7cb49afa092a69af409a01e.tar.gz
exit: Add PANIC_ON_RECURSIVE_FAULT Kconfig option
If a recursive fault is detected during do_exit(), tasks are left to sit and wait in an un-interruptible sleep until the system reboots (typically manually). Add Kconfig option to change this behaviour and force a panic. This is particularly important if a critical system task encounters a recursive fault (ex. a kworker). Otherwise, the system may be unusable, but since the scheduler is still running system watchdogs may continue to be pet. Change-Id: Ifc26fc79d6066f05a3b2c4d27f78bf4f8d2bd640 Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
-rw-r--r--kernel/exit.c4
-rw-r--r--lib/Kconfig.debug11
2 files changed, 15 insertions, 0 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 07db1173a6f..5b780f35111 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -752,8 +752,12 @@ void do_exit(long code)
* leave this task alone and wait for reboot.
*/
if (unlikely(tsk->flags & PF_EXITING)) {
+#ifdef CONFIG_PANIC_ON_RECURSIVE_FAULT
+ panic("Recursive fault!\n");
+#else
printk(KERN_ALERT
"Fixing recursive fault but reboot is needed!\n");
+#endif
/*
* We can do this unlocked here. The futex code uses
* this flag just to verify whether the pi state
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 78e556da2f6..ece0eb47845 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -285,6 +285,17 @@ config PANIC_ON_OOPS_VALUE
default 0 if !PANIC_ON_OOPS
default 1 if PANIC_ON_OOPS
+config PANIC_ON_RECURSIVE_FAULT
+ bool "Panic on recursive faults during task exit"
+ help
+ Panic upon the detection of a recursive fault during task exit,
+ rather than putting the task into an uninterruptible sleep.
+ This is particularly useful for debugging system hangs in
+ scenarios where the task experiencing the fault is critical
+ for system operation, rendering the system inoperable.
+
+ Say N if unsure.
+
config DETECT_HUNG_TASK
bool "Detect Hung Tasks"
depends on DEBUG_KERNEL