Skip to content

Commit

Permalink
i386: speedup touch_nmi_watchdog
Browse files Browse the repository at this point in the history
Avoid dirtying remote cpu's memory if it already has the correct value.

Cc: Andi Kleen <[email protected]>
Cc: Konrad Rzeszutek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
akpm00 authored and Linus Torvalds committed Jul 17, 2007
1 parent 1c978b9 commit f289025
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions arch/i386/kernel/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ static unsigned int
last_irq_sums [NR_CPUS],
alert_counter [NR_CPUS];

void touch_nmi_watchdog (void)
void touch_nmi_watchdog(void)
{
if (nmi_watchdog > 0) {
unsigned cpu;
Expand All @@ -304,8 +304,10 @@ void touch_nmi_watchdog (void)
* Just reset the alert counters, (other CPUs might be
* spinning on locks we hold):
*/
for_each_present_cpu (cpu)
alert_counter[cpu] = 0;
for_each_present_cpu(cpu) {
if (alert_counter[cpu])
alert_counter[cpu] = 0;
}
}

/*
Expand Down

0 comments on commit f289025

Please sign in to comment.