Re: [thisops uV3 07/18] highmem: Use this_cpu_xx_return() operations

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

On Tue, 30 Nov 2010, Peter Zijlstra wrote:


Ok with right spacing this is:

Subject: highmem: Use this_cpu_dec instead of __this_cpu_dec_return if
!DEBUG_HIGHMEM

Signed-off-by: Christoph Lameter <cl@linux.com>

---
 include/linux/highmem.h |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Index: linux-2.6/include/linux/highmem.h
===================================================================
--- linux-2.6.orig/include/linux/highmem.h	2010-11-30 13:23:44.000000000 -0600
+++ linux-2.6/include/linux/highmem.h	2010-11-30 13:51:39.000000000 -0600
@@ -95,13 +95,15 @@ static inline int kmap_atomic_idx(void)
 	return __this_cpu_read(__kmap_atomic_idx) - 1;
 }

-static inline int kmap_atomic_idx_pop(void)
+static inline void kmap_atomic_idx_pop(void)
 {
-	int idx = __this_cpu_dec_return(__kmap_atomic_idx);
 #ifdef CONFIG_DEBUG_HIGHMEM
+	int idx = __this_cpu_dec_return(__kmap_atomic_idx);
+
 	BUG_ON(idx < 0);
+#else
+	__this_cpu_dec(__kmap_atomic_idx);
 #endif
-	return idx;
 }

 #endif

--
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)