aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/softlockup.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/softlockup.c')
-rw-r--r--kernel/softlockup.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/softlockup.c b/kernel/softlockup.c
index 01b6522fd92b..78e0ad21cb0c 100644
--- a/kernel/softlockup.c
+++ b/kernel/softlockup.c
@@ -27,6 +27,21 @@ static DEFINE_PER_CPU(struct task_struct *, watchdog_task);
27static int __read_mostly did_panic; 27static int __read_mostly did_panic;
28unsigned long __read_mostly softlockup_thresh = 60; 28unsigned long __read_mostly softlockup_thresh = 60;
29 29
30/*
31 * Should we panic (and reboot, if panic_timeout= is set) when a
32 * soft-lockup occurs:
33 */
34unsigned int __read_mostly softlockup_panic =
35 CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE;
36
37static int __init softlockup_panic_setup(char *str)
38{
39 softlockup_panic = simple_strtoul(str, NULL, 0);
40
41 return 1;
42}
43__setup("softlockup_panic=", softlockup_panic_setup);
44
30static int 45static int
31softlock_panic(struct notifier_block *this, unsigned long event, void *ptr) 46softlock_panic(struct notifier_block *this, unsigned long event, void *ptr)
32{ 47{
@@ -120,6 +135,9 @@ void softlockup_tick(void)
120 else 135 else
121 dump_stack(); 136 dump_stack();
122 spin_unlock(&print_lock); 137 spin_unlock(&print_lock);
138
139 if (softlockup_panic)
140 panic("softlockup: hung tasks");
123} 141}
124 142
125/* 143/*
@@ -172,6 +190,9 @@ static void check_hung_task(struct task_struct *t, unsigned long now)
172 190
173 t->last_switch_timestamp = now; 191 t->last_switch_timestamp = now;
174 touch_nmi_watchdog(); 192 touch_nmi_watchdog();
193
194 if (softlockup_panic)
195 panic("softlockup: blocked tasks");
175} 196}
176 197
177/* 198/*