From: Jan Beulich Date: Thu, 7 Dec 2006 01:14:09 +0000 (+0100) Subject: [PATCH] i386: Don't touch per cpu memory of offline CPUs in touch_nmi_watchdog X-Git-Tag: v2.6.20-rc1~145^2^2~8^2~58 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=c6ea396de6836bdeb2d2433368130642bf0f6e15;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: Andi Kleen --- diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c index 171194ccb7b..f5bc7e1be80 100644 --- a/arch/i386/kernel/nmi.c +++ b/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: