[rfc 33/45] x86_64: Use CPU ops for nmi alert counter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



These are critical fast paths. Using a segment override instead of an address
calculation is reducing overhead.

Signed-off-by: Christoph LAmeter <[email protected]>
---
 arch/x86/kernel/nmi_64.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Index: linux-2.6/arch/x86/kernel/nmi_64.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/nmi_64.c	2007-11-19 15:38:59.522056618 -0800
+++ linux-2.6/arch/x86/kernel/nmi_64.c	2007-11-19 15:40:04.481556226 -0800
@@ -291,7 +291,7 @@ void stop_apic_nmi_watchdog(void *unused
  */
 
 static DEFINE_PER_CPU(unsigned, last_irq_sum);
-static DEFINE_PER_CPU(local_t, alert_counter);
+static DEFINE_PER_CPU(int, alert_counter);
 static DEFINE_PER_CPU(int, nmi_touch);
 
 void touch_nmi_watchdog(void)
@@ -355,13 +355,13 @@ int __kprobes nmi_watchdog_tick(struct p
 		 * Ayiee, looks like this CPU is stuck ...
 		 * wait a few IRQs (5 seconds) before doing the oops ...
 		 */
-		local_inc(&__get_cpu_var(alert_counter));
-		if (local_read(&__get_cpu_var(alert_counter)) == 5*nmi_hz)
+		CPU_INC(get_cpu_var(alert_counter));
+		if (CPU_READ(get_cpu_var(alert_counter)) == 5*nmi_hz)
 			die_nmi("NMI Watchdog detected LOCKUP on CPU %d\n", regs,
 				panic_on_timeout);
 	} else {
 		__get_cpu_var(last_irq_sum) = sum;
-		local_set(&__get_cpu_var(alert_counter), 0);
+		CPU_WRITE(get_cpu_var(alert_counter), 0);
 	}
 
 	/* see if the nmi watchdog went off */

-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux