mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 05:29:04 -04:00
softlockup: allow panic on lockup
allow users to configure the softlockup detector to generate a panic instead of a warning message. high-availability systems might opt for this strict method (combined with panic_timeout= boot option/sysctl), instead of generating softlockup warnings ad infinitum. also, automated tests work better if the system reboots reliably (into a safe kernel) in case of a lockup. The full spectrum of configurability is supported: boot option, sysctl option and Kconfig option. it's default-disabled. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
75d3bce2fc
commit
9c44bc03ff
5 changed files with 62 additions and 2 deletions
|
|
@ -27,6 +27,21 @@ static DEFINE_PER_CPU(struct task_struct *, watchdog_task);
|
|||
static int __read_mostly did_panic;
|
||||
unsigned long __read_mostly softlockup_thresh = 60;
|
||||
|
||||
/*
|
||||
* Should we panic (and reboot, if panic_timeout= is set) when a
|
||||
* soft-lockup occurs:
|
||||
*/
|
||||
unsigned int __read_mostly softlockup_panic =
|
||||
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE;
|
||||
|
||||
static int __init softlockup_panic_setup(char *str)
|
||||
{
|
||||
softlockup_panic = simple_strtoul(str, NULL, 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
__setup("softlockup_panic=", softlockup_panic_setup);
|
||||
|
||||
static int
|
||||
softlock_panic(struct notifier_block *this, unsigned long event, void *ptr)
|
||||
{
|
||||
|
|
@ -120,6 +135,9 @@ void softlockup_tick(void)
|
|||
else
|
||||
dump_stack();
|
||||
spin_unlock(&print_lock);
|
||||
|
||||
if (softlockup_panic)
|
||||
panic("softlockup: hung tasks");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -172,6 +190,9 @@ static void check_hung_task(struct task_struct *t, unsigned long now)
|
|||
|
||||
t->last_switch_timestamp = now;
|
||||
touch_nmi_watchdog();
|
||||
|
||||
if (softlockup_panic)
|
||||
panic("softlockup: blocked tasks");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -727,6 +727,17 @@ static struct ctl_table kern_table[] = {
|
|||
},
|
||||
#endif
|
||||
#ifdef CONFIG_DETECT_SOFTLOCKUP
|
||||
{
|
||||
.ctl_name = CTL_UNNUMBERED,
|
||||
.procname = "softlockup_panic",
|
||||
.data = &softlockup_panic,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_doulongvec_minmax,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &zero,
|
||||
.extra2 = &one,
|
||||
},
|
||||
{
|
||||
.ctl_name = CTL_UNNUMBERED,
|
||||
.procname = "softlockup_thresh",
|
||||
|
|
|
|||
Loading…
Reference in a new issue