Skip to contentSkip to conversation

i386: conditionalize touching of memory in touch_nmi_watchdog()

PATCH New Jan Beulich 1 participant 1 message Nov 15, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i386: conditionalize touching of memory in touch_nmi_watchdog()

Just like on x86-64, don't touch foreign CPUs' memory if the watchdog isn't enabled at all.

arch/i386/kernel/nmi.c +9 -7
@@ -867,14 +867,16 @@ static unsigned int
 
 void touch_nmi_watchdog (void)
 {
-	int i;
+	if (nmi_watchdog > 0) {
+		unsigned cpu;
 
-	/*
-	 * Just reset the alert counters, (other CPUs might be
-	 * spinning on locks we hold):
-	 */
-	for_each_possible_cpu(i)
-		alert_counter[i] = 0;
+		/*
+		 * Just reset the alert counters, (other CPUs might be
+		 * spinning on locks we hold):
+		 */
+		for_each_present_cpu (cpu)
+			alert_counter[cpu] = 0;
+	}
 
 	/*
 	 * Tickle the softlockup detector too: