[cpuops inc_return V1 3/9] x86: Use this_cpu_inc_return for nmi counter

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Christoph Lameter
Date: Monday, December 6, 2010 - 10:40 am

this_cpu_inc_return() saves us a memory access there.

Reviewed-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Christoph Lameter <cl@linux.com>

---
 arch/x86/kernel/apic/nmi.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Index: linux-2.6/arch/x86/kernel/apic/nmi.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/apic/nmi.c	2010-11-23 16:35:19.000000000 -0600
+++ linux-2.6/arch/x86/kernel/apic/nmi.c	2010-11-23 16:38:29.000000000 -0600
@@ -432,8 +432,7 @@ nmi_watchdog_tick(struct pt_regs *regs,
 		 * Ayiee, looks like this CPU is stuck ...
 		 * wait a few IRQs (5 seconds) before doing the oops ...
 		 */
-		__this_cpu_inc(alert_counter);
-		if (__this_cpu_read(alert_counter) == 5 * nmi_hz)
+		if (__this_cpu_inc_return(alert_counter) == 5 * nmi_hz)
 			/*
 			 * die_nmi will return ONLY if NOTIFY_STOP happens..
 			 */

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[cpuops inc_return V1 0/9] Implement this_cpu_inc_return ( ..., Christoph Lameter, (Mon Dec 6, 10:39 am)
[cpuops inc_return V1 2/9] x86: Support for this_cpu_add,s ..., Christoph Lameter, (Mon Dec 6, 10:40 am)
[cpuops inc_return V1 3/9] x86: Use this_cpu_inc_return fo ..., Christoph Lameter, (Mon Dec 6, 10:40 am)
Straggler: Connector: Use this_cpu_operations, Christoph Lameter, (Tue Dec 7, 8:46 am)
Re: [cpuops inc_return V1 3/9] x86: Use this_cpu_inc_retur ..., Christoph Lameter, (Wed Dec 8, 10:31 am)