aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/nmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/kernel/nmi.c')
-rw-r--r--arch/x86_64/kernel/nmi.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c
index 8be407a1f62d..5bf17e41cd2d 100644
--- a/arch/x86_64/kernel/nmi.c
+++ b/arch/x86_64/kernel/nmi.c
@@ -236,6 +236,7 @@ static void enable_lapic_nmi_watchdog(void)
236{ 236{
237 if (nmi_active < 0) { 237 if (nmi_active < 0) {
238 nmi_watchdog = NMI_LOCAL_APIC; 238 nmi_watchdog = NMI_LOCAL_APIC;
239 touch_nmi_watchdog();
239 setup_apic_nmi_watchdog(); 240 setup_apic_nmi_watchdog();
240 } 241 }
241} 242}
@@ -456,15 +457,17 @@ static DEFINE_PER_CPU(int, nmi_touch);
456 457
457void touch_nmi_watchdog (void) 458void touch_nmi_watchdog (void)
458{ 459{
459 int i; 460 if (nmi_watchdog > 0) {
461 unsigned cpu;
460 462
461 /* 463 /*
462 * Tell other CPUs to reset their alert counters. We cannot 464 * Tell other CPUs to reset their alert counters. We cannot
463 * do it ourselves because the alert count increase is not 465 * do it ourselves because the alert count increase is not
464 * atomic. 466 * atomic.
465 */ 467 */
466 for (i = 0; i < NR_CPUS; i++) 468 for_each_present_cpu (cpu)
467 per_cpu(nmi_touch, i) = 1; 469 per_cpu(nmi_touch, cpu) = 1;
470 }
468 471
469 touch_softlockup_watchdog(); 472 touch_softlockup_watchdog();
470} 473}