瀏覽代碼

[PATCH] i386: Don't touch per cpu memory of offline CPUs in touch_nmi_watchdog

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

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Jan Beulich 18 年之前
父節點
當前提交
c6ea396de6
共有 1 個文件被更改,包括 9 次插入7 次删除
  1. 9 7
      arch/i386/kernel/nmi.c

+ 9 - 7
arch/i386/kernel/nmi.c

@@ -870,14 +870,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: