watchdog.c (d834a9dcecae834cd6b2bc5e50e1907738d9cf6a) | watchdog.c (5dc3055879b8f659f62abb7c3d1eaa4d02e36d65) |
---|---|
1/* 2 * Detect hard and soft lockups on a system 3 * 4 * started by Don Zickus, Copyright (C) 2010 Red Hat, Inc. 5 * 6 * this code detects hard lockups: incidents in where on a CPU 7 * the kernel does not respond to anything except NMI. 8 * --- 43 unchanged lines hidden (view full) --- 52 */ 53#ifdef CONFIG_HARDLOCKUP_DETECTOR 54static int hardlockup_panic; 55 56static int __init hardlockup_panic_setup(char *str) 57{ 58 if (!strncmp(str, "panic", 5)) 59 hardlockup_panic = 1; | 1/* 2 * Detect hard and soft lockups on a system 3 * 4 * started by Don Zickus, Copyright (C) 2010 Red Hat, Inc. 5 * 6 * this code detects hard lockups: incidents in where on a CPU 7 * the kernel does not respond to anything except NMI. 8 * --- 43 unchanged lines hidden (view full) --- 52 */ 53#ifdef CONFIG_HARDLOCKUP_DETECTOR 54static int hardlockup_panic; 55 56static int __init hardlockup_panic_setup(char *str) 57{ 58 if (!strncmp(str, "panic", 5)) 59 hardlockup_panic = 1; |
60 else if (!strncmp(str, "0", 1)) 61 no_watchdog = 1; |
|
60 return 1; 61} 62__setup("nmi_watchdog=", hardlockup_panic_setup); 63#endif 64 65unsigned int __read_mostly softlockup_panic = 66 CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE; 67 --- 474 unchanged lines hidden (view full) --- 542 } 543 return notifier_from_errno(err); 544} 545 546static struct notifier_block __cpuinitdata cpu_nfb = { 547 .notifier_call = cpu_callback 548}; 549 | 62 return 1; 63} 64__setup("nmi_watchdog=", hardlockup_panic_setup); 65#endif 66 67unsigned int __read_mostly softlockup_panic = 68 CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE; 69 --- 474 unchanged lines hidden (view full) --- 544 } 545 return notifier_from_errno(err); 546} 547 548static struct notifier_block __cpuinitdata cpu_nfb = { 549 .notifier_call = cpu_callback 550}; 551 |
550static int __init spawn_watchdog_task(void) | 552void __init lockup_detector_init(void) |
551{ 552 void *cpu = (void *)(long)smp_processor_id(); 553 int err; 554 555 if (no_watchdog) | 553{ 554 void *cpu = (void *)(long)smp_processor_id(); 555 int err; 556 557 if (no_watchdog) |
556 return 0; | 558 return; |
557 558 err = cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu); 559 WARN_ON(notifier_to_errno(err)); 560 561 cpu_callback(&cpu_nfb, CPU_ONLINE, cpu); 562 register_cpu_notifier(&cpu_nfb); 563 | 559 560 err = cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu); 561 WARN_ON(notifier_to_errno(err)); 562 563 cpu_callback(&cpu_nfb, CPU_ONLINE, cpu); 564 register_cpu_notifier(&cpu_nfb); 565 |
564 return 0; | 566 return; |
565} | 567} |
566early_initcall(spawn_watchdog_task); | |