[thisops uV3 05/18] x86: Use this_cpu_inc_return for nmi counter

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Christoph Lameter
Date: Tuesday, November 30, 2010 - 12:07 pm

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:
[thisops uV3 00/18] Upgrade of this_cpu_ops V3, Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 01/18] percpucounter: Optimize __percpu_count ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 02/18] vmstat: Optimize zone counter modifica ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 03/18] percpu: Generic support for this_cpu_a ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 04/18] x86: Support for this_cpu_add,sub,dec, ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 05/18] x86: Use this_cpu_inc_return for nmi c ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 06/18] vmstat: Use this_cpu_inc_return for vm ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 07/18] highmem: Use this_cpu_xx_return() oper ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 08/18] Taskstats: Use this_cpu_ops, Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 09/18] fs: Use this_cpu_xx operations in buffer.c, Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 10/18] x86: Use this_cpu_ops to optimize code, Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 11/18] x86: Use this_cpu_ops for current_cpu_ ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 12/18] Core: Replace __get_cpu_var with __thi ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 13/18] drivers: Replace __get_cpu_var with __ ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 14/18] lguest: Use this_cpu_ops, Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 15/18] Xen: Use this_cpu_ops, Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 16/18] kprobes: Use this_cpu_ops, Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 17/18] Connector: Use this_cpu operations, Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 18/18] Fakekey: Simplify speakup_fake_key_pre ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
Re: [thisops uV3 07/18] highmem: Use this_cpu_xx_return() ..., Christoph Lameter, (Tue Nov 30, 12:26 pm)
Re: [thisops uV3 07/18] highmem: Use this_cpu_xx_return() ..., Christoph Lameter, (Tue Nov 30, 12:53 pm)
[extra] timers: Use this_cpu_read, Christoph Lameter, (Tue Nov 30, 1:05 pm)
Re: [thisops uV3 15/18] Xen: Use this_cpu_ops, Jeremy Fitzhardinge, (Tue Nov 30, 1:53 pm)
Re: [thisops uV3 15/18] Xen: Use this_cpu_ops, Christoph Lameter, (Tue Nov 30, 2:03 pm)
Re: [thisops uV3 08/18] Taskstats: Use this_cpu_ops, Michael Holzheu, (Wed Dec 1, 11:06 am)
Re: [thisops uV3 08/18] Taskstats: Use this_cpu_ops, Christoph Lameter, (Wed Dec 1, 11:13 am)
Re: [thisops uV3 14/18] lguest: Use this_cpu_ops, Rusty Russell, (Mon Dec 6, 12:46 am)
Re: [thisops uV3 08/18] Taskstats: Use this_cpu_ops, Balbir Singh, (Mon Dec 6, 7:32 am)
Re: [thisops uV3 14/18] lguest: Use this_cpu_ops, Christoph Lameter, (Mon Dec 6, 8:54 am)
Re: [thisops uV3 08/18] Taskstats: Use this_cpu_ops, Christoph Lameter, (Tue Dec 7, 7:39 am)
[tip:timers/core] timers: Use this_cpu_read, tip-bot for Christop ..., (Sun Dec 12, 10:41 am)