diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2007-07-17 13:03:58 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-17 19:23:04 +0200 |
commit | 567f3e422a9a155d7c7643148efb5bf959065d34 (patch) | |
tree | 2b9959e3328fd78c4fe1ef371f02604de97c39eb | |
parent | i386: speedup touch_nmi_watchdog (diff) | |
download | linux-567f3e422a9a155d7c7643148efb5bf959065d34.tar.xz linux-567f3e422a9a155d7c7643148efb5bf959065d34.zip |
x86_64: speedup touch_nmi_watchdog
Avoid dirtying remote cpu's memory if it already has the correct value.
Cc: Andi Kleen <ak@suse.de>
Cc: Konrad Rzeszutek <konrad@darnok.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/x86_64/kernel/nmi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c index 931c64bad5e6..edbbc59b7523 100644 --- a/arch/x86_64/kernel/nmi.c +++ b/arch/x86_64/kernel/nmi.c @@ -296,7 +296,7 @@ static DEFINE_PER_CPU(unsigned, last_irq_sum); static DEFINE_PER_CPU(local_t, alert_counter); static DEFINE_PER_CPU(int, nmi_touch); -void touch_nmi_watchdog (void) +void touch_nmi_watchdog(void) { if (nmi_watchdog > 0) { unsigned cpu; @@ -306,8 +306,10 @@ void touch_nmi_watchdog (void) * do it ourselves because the alert count increase is not * atomic. */ - for_each_present_cpu (cpu) - per_cpu(nmi_touch, cpu) = 1; + for_each_present_cpu(cpu) { + if (per_cpu(nmi_touch, cpu) != 1) + per_cpu(nmi_touch, cpu) = 1; + } } touch_softlockup_watchdog(); |