From 4933b84d1d40682ee7cb49afa092a69af409a01e Mon Sep 17 00:00:00 2001 From: Matt Wagantall Date: Fri, 20 Mar 2015 12:54:57 -0700 Subject: 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 --- kernel/exit.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'kernel') 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 -- cgit v1.2.3