diff options
author | Ravikiran G Thirumalai <kiran@scalex86.org> | 2007-10-17 02:26:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:42:47 -0400 |
commit | c4f3b63fe15b4629aa1ec163c95ab30423d0f76a (patch) | |
tree | 432723f1c7ac2fcff0aa57377c31187140d69145 /kernel/softlockup.c | |
parent | a5f2ce3c6024a5bb895647b6bd88ecae5001020a (diff) |
softlockup: add a /proc tuning parameter
Control the trigger limit for softlockup warnings. This is useful for
debugging softlockups, by lowering the softlockup_thresh to identify
possible softlockups earlier.
This patch:
1. Adds a sysctl softlockup_thresh with valid values of 1-60s
(Higher value to disable false positives)
2. Changes the softlockup printk to print the cpu softlockup time
[akpm@linux-foundation.org: Fix various warnings and add definition of "two"]
Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/softlockup.c')
-rw-r--r-- | kernel/softlockup.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/softlockup.c b/kernel/softlockup.c index 72c2561ff5f8..edeeef3a6a32 100644 --- a/kernel/softlockup.c +++ b/kernel/softlockup.c | |||
@@ -24,6 +24,7 @@ static DEFINE_PER_CPU(unsigned long, print_timestamp); | |||
24 | static DEFINE_PER_CPU(struct task_struct *, watchdog_task); | 24 | static DEFINE_PER_CPU(struct task_struct *, watchdog_task); |
25 | 25 | ||
26 | static int did_panic; | 26 | static int did_panic; |
27 | int softlockup_thresh = 10; | ||
27 | 28 | ||
28 | static int | 29 | static int |
29 | softlock_panic(struct notifier_block *this, unsigned long event, void *ptr) | 30 | softlock_panic(struct notifier_block *this, unsigned long event, void *ptr) |
@@ -104,13 +105,15 @@ void softlockup_tick(void) | |||
104 | wake_up_process(per_cpu(watchdog_task, this_cpu)); | 105 | wake_up_process(per_cpu(watchdog_task, this_cpu)); |
105 | 106 | ||
106 | /* Warn about unreasonable 10+ seconds delays: */ | 107 | /* Warn about unreasonable 10+ seconds delays: */ |
107 | if (now <= (touch_timestamp + 10)) | 108 | if (now <= (touch_timestamp + softlockup_thresh)) |
108 | return; | 109 | return; |
109 | 110 | ||
110 | per_cpu(print_timestamp, this_cpu) = touch_timestamp; | 111 | per_cpu(print_timestamp, this_cpu) = touch_timestamp; |
111 | 112 | ||
112 | spin_lock(&print_lock); | 113 | spin_lock(&print_lock); |
113 | printk(KERN_ERR "BUG: soft lockup detected on CPU#%d!\n", this_cpu); | 114 | printk(KERN_ERR "BUG: soft lockup - CPU#%d stuck for %lus! [%s:%d]\n", |
115 | this_cpu, now - touch_timestamp, | ||
116 | current->comm, current->pid); | ||
114 | if (regs) | 117 | if (regs) |
115 | show_regs(regs); | 118 | show_regs(regs); |
116 | else | 119 | else |