]> err.no Git - linux-2.6/blobdiff - kernel/softlockup.c
Merge branch 'fixes-jgarzik' of git://git.kernel.org/pub/scm/linux/kernel/git/linvill...
[linux-2.6] / kernel / softlockup.c
index 65839c54abf52a1a6c971dcae19b42cfd4b31f03..11df812263c8fd3eed16f4f1a57d36a68f6eaedc 100644 (file)
@@ -23,7 +23,8 @@ static DEFINE_PER_CPU(unsigned long, touch_timestamp);
 static DEFINE_PER_CPU(unsigned long, print_timestamp);
 static DEFINE_PER_CPU(struct task_struct *, watchdog_task);
 
-static int did_panic = 0;
+static int did_panic;
+int softlockup_thresh = 10;
 
 static int
 softlock_panic(struct notifier_block *this, unsigned long event, void *ptr)
@@ -104,13 +105,15 @@ void softlockup_tick(void)
                wake_up_process(per_cpu(watchdog_task, this_cpu));
 
        /* Warn about unreasonable 10+ seconds delays: */
-       if (now <= (touch_timestamp + 10))
+       if (now <= (touch_timestamp + softlockup_thresh))
                return;
 
        per_cpu(print_timestamp, this_cpu) = touch_timestamp;
 
        spin_lock(&print_lock);
-       printk(KERN_ERR "BUG: soft lockup detected on CPU#%d!\n", this_cpu);
+       printk(KERN_ERR "BUG: soft lockup - CPU#%d stuck for %lus! [%s:%d]\n",
+                       this_cpu, now - touch_timestamp,
+                       current->comm, task_pid_nr(current));
        if (regs)
                show_regs(regs);
        else
@@ -121,7 +124,7 @@ void softlockup_tick(void)
 /*
  * The watchdog thread - runs every second and touches the timestamp.
  */
-static int watchdog(void * __bind_cpu)
+static int watchdog(void *__bind_cpu)
 {
        struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 };
 
@@ -159,13 +162,13 @@ cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
                BUG_ON(per_cpu(watchdog_task, hotcpu));
                p = kthread_create(watchdog, hcpu, "watchdog/%d", hotcpu);
                if (IS_ERR(p)) {
-                       printk("watchdog for %i failed\n", hotcpu);
+                       printk(KERN_ERR "watchdog for %i failed\n", hotcpu);
                        return NOTIFY_BAD;
                }
-               per_cpu(touch_timestamp, hotcpu) = 0;
-               per_cpu(watchdog_task, hotcpu) = p;
+               per_cpu(touch_timestamp, hotcpu) = 0;
+               per_cpu(watchdog_task, hotcpu) = p;
                kthread_bind(p, hotcpu);
-               break;
+               break;
        case CPU_ONLINE:
        case CPU_ONLINE_FROZEN:
                wake_up_process(per_cpu(watchdog_task, hotcpu));
@@ -185,7 +188,7 @@ cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
                kthread_stop(p);
                break;
 #endif /* CONFIG_HOTPLUG_CPU */
-       }
+       }
        return NOTIFY_OK;
 }