aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDavidlohr Bueso <davidlohr@hp.com>2014-06-29 18:09:33 -0400
committerIngo Molnar <mingo@kernel.org>2014-07-17 06:32:47 -0400
commit3a6bfbc91df04b081a44d419e0260bad54abddf7 (patch)
treef83d654657f75f565b11619a3e7211554ac5cb47 /arch
parentacf59377267b5a74818e76873d0670b0ca6cf2fe (diff)
arch, locking: Ciao arch_mutex_cpu_relax()
The arch_mutex_cpu_relax() function, introduced by 34b133f, is hacky and ugly. It was added a few years ago to address the fact that common cpu_relax() calls include yielding on s390, and thus impact the optimistic spinning functionality of mutexes. Nowadays we use this function well beyond mutexes: rwsem, qrwlock, mcs and lockref. Since the macro that defines the call is in the mutex header, any users must include mutex.h and the naming is misleading as well. This patch (i) renames the call to cpu_relax_lowlatency ("relax, but only if you can do it with very low latency") and (ii) defines it in each arch's asm/processor.h local header, just like for regular cpu_relax functions. On all archs, except s390, cpu_relax_lowlatency is simply cpu_relax, and thus we can take it out of mutex.h. While this can seem redundant, I believe it is a good choice as it allows us to move out arch specific logic from generic locking primitives and enables future(?) archs to transparently define it, similarly to System Z. Signed-off-by: Davidlohr Bueso <davidlohr@hp.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Anton Blanchard <anton@samba.org> Cc: Aurelien Jacquiot <a-jacquiot@ti.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Bharat Bhushan <r65777@freescale.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Chen Liqin <liqin.linux@gmail.com> Cc: Chris Metcalf <cmetcalf@tilera.com> Cc: Christian Borntraeger <borntraeger@de.ibm.com> Cc: Chris Zankel <chris@zankel.net> Cc: David Howells <dhowells@redhat.com> Cc: David S. Miller <davem@davemloft.net> Cc: Deepthi Dharwar <deepthi@linux.vnet.ibm.com> Cc: Dominik Dingel <dingel@linux.vnet.ibm.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Cc: Haavard Skinnemoen <hskinnemoen@gmail.com> Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Helge Deller <deller@gmx.de> Cc: Hirokazu Takata <takata@linux-m32r.org> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: James E.J. Bottomley <jejb@parisc-linux.org> Cc: James Hogan <james.hogan@imgtec.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Jesper Nilsson <jesper.nilsson@axis.com> Cc: Joe Perches <joe@perches.com> Cc: Jonas Bonn <jonas@southpole.se> Cc: Joseph Myers <joseph@codesourcery.com> Cc: Kees Cook <keescook@chromium.org> Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com> Cc: Lennox Wu <lennox.wu@gmail.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mark Salter <msalter@redhat.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Matt Turner <mattst88@gmail.com> Cc: Max Filippov <jcmvbkbc@gmail.com> Cc: Michael Neuling <mikey@neuling.org> Cc: Michal Simek <monstr@monstr.eu> Cc: Mikael Starvik <starvik@axis.com> Cc: Nicolas Pitre <nico@linaro.org> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Paul Burton <paul.burton@imgtec.com> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Qais Yousef <qais.yousef@imgtec.com> Cc: Qiaowei Ren <qiaowei.ren@intel.com> Cc: Rafael Wysocki <rafael.j.wysocki@intel.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Richard Henderson <rth@twiddle.net> Cc: Richard Kuo <rkuo@codeaurora.org> Cc: Russell King <linux@arm.linux.org.uk> Cc: Steven Miao <realmz6@gmail.com> Cc: Steven Rostedt <srostedt@redhat.com> Cc: Stratos Karafotis <stratosk@semaphore.gr> Cc: Tim Chen <tim.c.chen@linux.intel.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Vasily Kulikov <segoon@openwall.com> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com> Cc: Waiman Long <Waiman.Long@hp.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Wolfram Sang <wsa@the-dreams.de> Cc: adi-buildroot-devel@lists.sourceforge.net Cc: linux390@de.ibm.com Cc: linux-alpha@vger.kernel.org Cc: linux-am33-list@redhat.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-c6x-dev@linux-c6x.org Cc: linux-cris-kernel@axis.com Cc: linux-hexagon@vger.kernel.org Cc: linux-ia64@vger.kernel.org Cc: linux@lists.openrisc.net Cc: linux-m32r-ja@ml.linux-m32r.org Cc: linux-m32r@ml.linux-m32r.org Cc: linux-m68k@lists.linux-m68k.org Cc: linux-metag@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: linux-parisc@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-s390@vger.kernel.org Cc: linux-sh@vger.kernel.org Cc: linux-xtensa@linux-xtensa.org Cc: sparclinux@vger.kernel.org Link: http://lkml.kernel.org/r/1404079773.2619.4.camel@buesod1.americas.hpqcorp.net Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/include/asm/processor.h1
-rw-r--r--arch/arc/include/asm/processor.h2
-rw-r--r--arch/arm/include/asm/processor.h2
-rw-r--r--arch/arm64/include/asm/processor.h1
-rw-r--r--arch/avr32/include/asm/processor.h1
-rw-r--r--arch/blackfin/include/asm/processor.h2
-rw-r--r--arch/c6x/include/asm/processor.h1
-rw-r--r--arch/cris/include/asm/processor.h1
-rw-r--r--arch/hexagon/include/asm/processor.h1
-rw-r--r--arch/ia64/include/asm/processor.h1
-rw-r--r--arch/m32r/include/asm/processor.h1
-rw-r--r--arch/m68k/include/asm/processor.h1
-rw-r--r--arch/metag/include/asm/processor.h1
-rw-r--r--arch/microblaze/include/asm/processor.h1
-rw-r--r--arch/mips/include/asm/processor.h1
-rw-r--r--arch/mn10300/include/asm/processor.h2
-rw-r--r--arch/openrisc/include/asm/processor.h1
-rw-r--r--arch/parisc/include/asm/processor.h1
-rw-r--r--arch/powerpc/include/asm/processor.h2
-rw-r--r--arch/s390/include/asm/processor.h2
-rw-r--r--arch/score/include/asm/processor.h1
-rw-r--r--arch/sh/include/asm/processor.h1
-rw-r--r--arch/sparc/include/asm/processor_32.h2
-rw-r--r--arch/sparc/include/asm/processor_64.h1
-rw-r--r--arch/tile/include/asm/processor.h2
-rw-r--r--arch/unicore32/include/asm/processor.h1
-rw-r--r--arch/x86/include/asm/processor.h2
-rw-r--r--arch/x86/um/asm/processor.h3
-rw-r--r--arch/xtensa/include/asm/processor.h1
29 files changed, 37 insertions, 3 deletions
diff --git a/arch/alpha/include/asm/processor.h b/arch/alpha/include/asm/processor.h
index 6cb7fe85c4b5..b4cf03690394 100644
--- a/arch/alpha/include/asm/processor.h
+++ b/arch/alpha/include/asm/processor.h
@@ -57,6 +57,7 @@ unsigned long get_wchan(struct task_struct *p);
57 ((tsk) == current ? rdusp() : task_thread_info(tsk)->pcb.usp) 57 ((tsk) == current ? rdusp() : task_thread_info(tsk)->pcb.usp)
58 58
59#define cpu_relax() barrier() 59#define cpu_relax() barrier()
60#define cpu_relax_lowlatency() cpu_relax()
60 61
61#define ARCH_HAS_PREFETCH 62#define ARCH_HAS_PREFETCH
62#define ARCH_HAS_PREFETCHW 63#define ARCH_HAS_PREFETCHW
diff --git a/arch/arc/include/asm/processor.h b/arch/arc/include/asm/processor.h
index d99f9b37cd15..82588f3ba77f 100644
--- a/arch/arc/include/asm/processor.h
+++ b/arch/arc/include/asm/processor.h
@@ -62,6 +62,8 @@ unsigned long thread_saved_pc(struct task_struct *t);
62#define cpu_relax() do { } while (0) 62#define cpu_relax() do { } while (0)
63#endif 63#endif
64 64
65#define cpu_relax_lowlatency() cpu_relax()
66
65#define copy_segments(tsk, mm) do { } while (0) 67#define copy_segments(tsk, mm) do { } while (0)
66#define release_segments(mm) do { } while (0) 68#define release_segments(mm) do { } while (0)
67 69
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h
index c3d5fc124a05..8a1e8e995dae 100644
--- a/arch/arm/include/asm/processor.h
+++ b/arch/arm/include/asm/processor.h
@@ -82,6 +82,8 @@ unsigned long get_wchan(struct task_struct *p);
82#define cpu_relax() barrier() 82#define cpu_relax() barrier()
83#endif 83#endif
84 84
85#define cpu_relax_lowlatency() cpu_relax()
86
85#define task_pt_regs(p) \ 87#define task_pt_regs(p) \
86 ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1) 88 ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1)
87 89
diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
index 34de2a8f7d93..4610b0daf1bf 100644
--- a/arch/arm64/include/asm/processor.h
+++ b/arch/arm64/include/asm/processor.h
@@ -129,6 +129,7 @@ extern void release_thread(struct task_struct *);
129unsigned long get_wchan(struct task_struct *p); 129unsigned long get_wchan(struct task_struct *p);
130 130
131#define cpu_relax() barrier() 131#define cpu_relax() barrier()
132#define cpu_relax_lowlatency() cpu_relax()
132 133
133/* Thread switching */ 134/* Thread switching */
134extern struct task_struct *cpu_switch_to(struct task_struct *prev, 135extern struct task_struct *cpu_switch_to(struct task_struct *prev,
diff --git a/arch/avr32/include/asm/processor.h b/arch/avr32/include/asm/processor.h
index 972adcc1e8f4..941593c7d9f3 100644
--- a/arch/avr32/include/asm/processor.h
+++ b/arch/avr32/include/asm/processor.h
@@ -92,6 +92,7 @@ extern struct avr32_cpuinfo boot_cpu_data;
92#define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3)) 92#define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3))
93 93
94#define cpu_relax() barrier() 94#define cpu_relax() barrier()
95#define cpu_relax_lowlatency() cpu_relax()
95#define cpu_sync_pipeline() asm volatile("sub pc, -2" : : : "memory") 96#define cpu_sync_pipeline() asm volatile("sub pc, -2" : : : "memory")
96 97
97struct cpu_context { 98struct cpu_context {
diff --git a/arch/blackfin/include/asm/processor.h b/arch/blackfin/include/asm/processor.h
index d0e72e9475a6..7acd46653df3 100644
--- a/arch/blackfin/include/asm/processor.h
+++ b/arch/blackfin/include/asm/processor.h
@@ -99,7 +99,7 @@ unsigned long get_wchan(struct task_struct *p);
99#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) 99#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
100 100
101#define cpu_relax() smp_mb() 101#define cpu_relax() smp_mb()
102 102#define cpu_relax_lowlatency() cpu_relax()
103 103
104/* Get the Silicon Revision of the chip */ 104/* Get the Silicon Revision of the chip */
105static inline uint32_t __pure bfin_revid(void) 105static inline uint32_t __pure bfin_revid(void)
diff --git a/arch/c6x/include/asm/processor.h b/arch/c6x/include/asm/processor.h
index b9eb3da7f278..f2ef31be2f8b 100644
--- a/arch/c6x/include/asm/processor.h
+++ b/arch/c6x/include/asm/processor.h
@@ -121,6 +121,7 @@ extern unsigned long get_wchan(struct task_struct *p);
121#define KSTK_ESP(task) (task_pt_regs(task)->sp) 121#define KSTK_ESP(task) (task_pt_regs(task)->sp)
122 122
123#define cpu_relax() do { } while (0) 123#define cpu_relax() do { } while (0)
124#define cpu_relax_lowlatency() cpu_relax()
124 125
125extern const struct seq_operations cpuinfo_op; 126extern const struct seq_operations cpuinfo_op;
126 127
diff --git a/arch/cris/include/asm/processor.h b/arch/cris/include/asm/processor.h
index 15b815df29c1..862126b58116 100644
--- a/arch/cris/include/asm/processor.h
+++ b/arch/cris/include/asm/processor.h
@@ -63,6 +63,7 @@ static inline void release_thread(struct task_struct *dead_task)
63#define init_stack (init_thread_union.stack) 63#define init_stack (init_thread_union.stack)
64 64
65#define cpu_relax() barrier() 65#define cpu_relax() barrier()
66#define cpu_relax_lowlatency() cpu_relax()
66 67
67void default_idle(void); 68void default_idle(void);
68 69
diff --git a/arch/hexagon/include/asm/processor.h b/arch/hexagon/include/asm/processor.h
index 45a825402f63..d8501137c8d0 100644
--- a/arch/hexagon/include/asm/processor.h
+++ b/arch/hexagon/include/asm/processor.h
@@ -56,6 +56,7 @@ struct thread_struct {
56} 56}
57 57
58#define cpu_relax() __vmyield() 58#define cpu_relax() __vmyield()
59#define cpu_relax_lowlatency() cpu_relax()
59 60
60/* 61/*
61 * Decides where the kernel will search for a free chunk of vm space during 62 * Decides where the kernel will search for a free chunk of vm space during
diff --git a/arch/ia64/include/asm/processor.h b/arch/ia64/include/asm/processor.h
index efd1b927ccb7..c7367130ab14 100644
--- a/arch/ia64/include/asm/processor.h
+++ b/arch/ia64/include/asm/processor.h
@@ -548,6 +548,7 @@ ia64_eoi (void)
548} 548}
549 549
550#define cpu_relax() ia64_hint(ia64_hint_pause) 550#define cpu_relax() ia64_hint(ia64_hint_pause)
551#define cpu_relax_lowlatency() cpu_relax()
551 552
552static inline int 553static inline int
553ia64_get_irr(unsigned int vector) 554ia64_get_irr(unsigned int vector)
diff --git a/arch/m32r/include/asm/processor.h b/arch/m32r/include/asm/processor.h
index 5767367550c6..9f8fd9bef70f 100644
--- a/arch/m32r/include/asm/processor.h
+++ b/arch/m32r/include/asm/processor.h
@@ -133,5 +133,6 @@ unsigned long get_wchan(struct task_struct *p);
133#define KSTK_ESP(tsk) ((tsk)->thread.sp) 133#define KSTK_ESP(tsk) ((tsk)->thread.sp)
134 134
135#define cpu_relax() barrier() 135#define cpu_relax() barrier()
136#define cpu_relax_lowlatency() cpu_relax()
136 137
137#endif /* _ASM_M32R_PROCESSOR_H */ 138#endif /* _ASM_M32R_PROCESSOR_H */
diff --git a/arch/m68k/include/asm/processor.h b/arch/m68k/include/asm/processor.h
index b0768a657920..20dda1d4b860 100644
--- a/arch/m68k/include/asm/processor.h
+++ b/arch/m68k/include/asm/processor.h
@@ -176,5 +176,6 @@ unsigned long get_wchan(struct task_struct *p);
176#define task_pt_regs(tsk) ((struct pt_regs *) ((tsk)->thread.esp0)) 176#define task_pt_regs(tsk) ((struct pt_regs *) ((tsk)->thread.esp0))
177 177
178#define cpu_relax() barrier() 178#define cpu_relax() barrier()
179#define cpu_relax_lowlatency() cpu_relax()
179 180
180#endif 181#endif
diff --git a/arch/metag/include/asm/processor.h b/arch/metag/include/asm/processor.h
index a8a37477c66e..881071c07942 100644
--- a/arch/metag/include/asm/processor.h
+++ b/arch/metag/include/asm/processor.h
@@ -155,6 +155,7 @@ unsigned long get_wchan(struct task_struct *p);
155#define user_stack_pointer(regs) ((regs)->ctx.AX[0].U0) 155#define user_stack_pointer(regs) ((regs)->ctx.AX[0].U0)
156 156
157#define cpu_relax() barrier() 157#define cpu_relax() barrier()
158#define cpu_relax_lowlatency() cpu_relax()
158 159
159extern void setup_priv(void); 160extern void setup_priv(void);
160 161
diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
index 9d31b057c355..497a988d79c2 100644
--- a/arch/microblaze/include/asm/processor.h
+++ b/arch/microblaze/include/asm/processor.h
@@ -22,6 +22,7 @@
22extern const struct seq_operations cpuinfo_op; 22extern const struct seq_operations cpuinfo_op;
23 23
24# define cpu_relax() barrier() 24# define cpu_relax() barrier()
25# define cpu_relax_lowlatency() cpu_relax()
25 26
26#define task_pt_regs(tsk) \ 27#define task_pt_regs(tsk) \
27 (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1) 28 (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1)
diff --git a/arch/mips/include/asm/processor.h b/arch/mips/include/asm/processor.h
index ad70cba8daff..d5098bc554f4 100644
--- a/arch/mips/include/asm/processor.h
+++ b/arch/mips/include/asm/processor.h
@@ -367,6 +367,7 @@ unsigned long get_wchan(struct task_struct *p);
367#define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status) 367#define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status)
368 368
369#define cpu_relax() barrier() 369#define cpu_relax() barrier()
370#define cpu_relax_lowlatency() cpu_relax()
370 371
371/* 372/*
372 * Return_address is a replacement for __builtin_return_address(count) 373 * Return_address is a replacement for __builtin_return_address(count)
diff --git a/arch/mn10300/include/asm/processor.h b/arch/mn10300/include/asm/processor.h
index 8b80b19d0c8a..769d5ed8e992 100644
--- a/arch/mn10300/include/asm/processor.h
+++ b/arch/mn10300/include/asm/processor.h
@@ -68,7 +68,9 @@ extern struct mn10300_cpuinfo cpu_data[];
68extern void identify_cpu(struct mn10300_cpuinfo *); 68extern void identify_cpu(struct mn10300_cpuinfo *);
69extern void print_cpu_info(struct mn10300_cpuinfo *); 69extern void print_cpu_info(struct mn10300_cpuinfo *);
70extern void dodgy_tsc(void); 70extern void dodgy_tsc(void);
71
71#define cpu_relax() barrier() 72#define cpu_relax() barrier()
73#define cpu_relax_lowlatency() cpu_relax()
72 74
73/* 75/*
74 * User space process size: 1.75GB (default). 76 * User space process size: 1.75GB (default).
diff --git a/arch/openrisc/include/asm/processor.h b/arch/openrisc/include/asm/processor.h
index cab746fa9e87..4d235e3d2534 100644
--- a/arch/openrisc/include/asm/processor.h
+++ b/arch/openrisc/include/asm/processor.h
@@ -101,6 +101,7 @@ extern unsigned long thread_saved_pc(struct task_struct *t);
101#define init_stack (init_thread_union.stack) 101#define init_stack (init_thread_union.stack)
102 102
103#define cpu_relax() barrier() 103#define cpu_relax() barrier()
104#define cpu_relax_lowlatency() cpu_relax()
104 105
105#endif /* __ASSEMBLY__ */ 106#endif /* __ASSEMBLY__ */
106#endif /* __ASM_OPENRISC_PROCESSOR_H */ 107#endif /* __ASM_OPENRISC_PROCESSOR_H */
diff --git a/arch/parisc/include/asm/processor.h b/arch/parisc/include/asm/processor.h
index d951c9681ab3..689a8ade3606 100644
--- a/arch/parisc/include/asm/processor.h
+++ b/arch/parisc/include/asm/processor.h
@@ -338,6 +338,7 @@ extern unsigned long get_wchan(struct task_struct *p);
338#define KSTK_ESP(tsk) ((tsk)->thread.regs.gr[30]) 338#define KSTK_ESP(tsk) ((tsk)->thread.regs.gr[30])
339 339
340#define cpu_relax() barrier() 340#define cpu_relax() barrier()
341#define cpu_relax_lowlatency() cpu_relax()
341 342
342/* Used as a macro to identify the combined VIPT/PIPT cached 343/* Used as a macro to identify the combined VIPT/PIPT cached
343 * CPUs which require a guarantee of coherency (no inequivalent 344 * CPUs which require a guarantee of coherency (no inequivalent
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index 6d59072e13a7..dda7ac4c80bd 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -400,6 +400,8 @@ static inline unsigned long __pack_fe01(unsigned int fpmode)
400#define cpu_relax() barrier() 400#define cpu_relax() barrier()
401#endif 401#endif
402 402
403#define cpu_relax_lowlatency() cpu_relax()
404
403/* Check that a certain kernel stack pointer is valid in task_struct p */ 405/* Check that a certain kernel stack pointer is valid in task_struct p */
404int validate_sp(unsigned long sp, struct task_struct *p, 406int validate_sp(unsigned long sp, struct task_struct *p,
405 unsigned long nbytes); 407 unsigned long nbytes);
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h
index 6f02d452bbee..e568fc8a7250 100644
--- a/arch/s390/include/asm/processor.h
+++ b/arch/s390/include/asm/processor.h
@@ -217,7 +217,7 @@ static inline void cpu_relax(void)
217 barrier(); 217 barrier();
218} 218}
219 219
220#define arch_mutex_cpu_relax() barrier() 220#define cpu_relax_lowlatency() barrier()
221 221
222static inline void psw_set_key(unsigned int key) 222static inline void psw_set_key(unsigned int key)
223{ 223{
diff --git a/arch/score/include/asm/processor.h b/arch/score/include/asm/processor.h
index d9a922d8711b..851f441991d2 100644
--- a/arch/score/include/asm/processor.h
+++ b/arch/score/include/asm/processor.h
@@ -24,6 +24,7 @@ extern unsigned long get_wchan(struct task_struct *p);
24#define current_text_addr() ({ __label__ _l; _l: &&_l; }) 24#define current_text_addr() ({ __label__ _l; _l: &&_l; })
25 25
26#define cpu_relax() barrier() 26#define cpu_relax() barrier()
27#define cpu_relax_lowlatency() cpu_relax()
27#define release_thread(thread) do {} while (0) 28#define release_thread(thread) do {} while (0)
28 29
29/* 30/*
diff --git a/arch/sh/include/asm/processor.h b/arch/sh/include/asm/processor.h
index 5448f9bbf4ab..1506897648aa 100644
--- a/arch/sh/include/asm/processor.h
+++ b/arch/sh/include/asm/processor.h
@@ -97,6 +97,7 @@ extern struct sh_cpuinfo cpu_data[];
97 97
98#define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory") 98#define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory")
99#define cpu_relax() barrier() 99#define cpu_relax() barrier()
100#define cpu_relax_lowlatency() cpu_relax()
100 101
101void default_idle(void); 102void default_idle(void);
102void stop_this_cpu(void *); 103void stop_this_cpu(void *);
diff --git a/arch/sparc/include/asm/processor_32.h b/arch/sparc/include/asm/processor_32.h
index a564817bbc2e..812fd08f3e62 100644
--- a/arch/sparc/include/asm/processor_32.h
+++ b/arch/sparc/include/asm/processor_32.h
@@ -119,6 +119,8 @@ extern struct task_struct *last_task_used_math;
119int do_mathemu(struct pt_regs *regs, struct task_struct *fpt); 119int do_mathemu(struct pt_regs *regs, struct task_struct *fpt);
120 120
121#define cpu_relax() barrier() 121#define cpu_relax() barrier()
122#define cpu_relax_lowlatency() cpu_relax()
123
122extern void (*sparc_idle)(void); 124extern void (*sparc_idle)(void);
123 125
124#endif 126#endif
diff --git a/arch/sparc/include/asm/processor_64.h b/arch/sparc/include/asm/processor_64.h
index 7028fe1a7c04..6924bdefe148 100644
--- a/arch/sparc/include/asm/processor_64.h
+++ b/arch/sparc/include/asm/processor_64.h
@@ -216,6 +216,7 @@ unsigned long get_wchan(struct task_struct *task);
216 "nop\n\t" \ 216 "nop\n\t" \
217 ".previous" \ 217 ".previous" \
218 ::: "memory") 218 ::: "memory")
219#define cpu_relax_lowlatency() cpu_relax()
219 220
220/* Prefetch support. This is tuned for UltraSPARC-III and later. 221/* Prefetch support. This is tuned for UltraSPARC-III and later.
221 * UltraSPARC-I will treat these as nops, and UltraSPARC-II has 222 * UltraSPARC-I will treat these as nops, and UltraSPARC-II has
diff --git a/arch/tile/include/asm/processor.h b/arch/tile/include/asm/processor.h
index 42323636c459..dd4f9f17e30a 100644
--- a/arch/tile/include/asm/processor.h
+++ b/arch/tile/include/asm/processor.h
@@ -266,6 +266,8 @@ static inline void cpu_relax(void)
266 barrier(); 266 barrier();
267} 267}
268 268
269#define cpu_relax_lowlatency() cpu_relax()
270
269/* Info on this processor (see fs/proc/cpuinfo.c) */ 271/* Info on this processor (see fs/proc/cpuinfo.c) */
270struct seq_operations; 272struct seq_operations;
271extern const struct seq_operations cpuinfo_op; 273extern const struct seq_operations cpuinfo_op;
diff --git a/arch/unicore32/include/asm/processor.h b/arch/unicore32/include/asm/processor.h
index 4eaa42167667..8d21b7adf26b 100644
--- a/arch/unicore32/include/asm/processor.h
+++ b/arch/unicore32/include/asm/processor.h
@@ -71,6 +71,7 @@ extern void release_thread(struct task_struct *);
71unsigned long get_wchan(struct task_struct *p); 71unsigned long get_wchan(struct task_struct *p);
72 72
73#define cpu_relax() barrier() 73#define cpu_relax() barrier()
74#define cpu_relax_lowlatency() cpu_relax()
74 75
75#define task_pt_regs(p) \ 76#define task_pt_regs(p) \
76 ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1) 77 ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1)
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index a4ea02351f4d..32cc237f8e20 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -696,6 +696,8 @@ static inline void cpu_relax(void)
696 rep_nop(); 696 rep_nop();
697} 697}
698 698
699#define cpu_relax_lowlatency() cpu_relax()
700
699/* Stop speculative execution and prefetching of modified code. */ 701/* Stop speculative execution and prefetching of modified code. */
700static inline void sync_core(void) 702static inline void sync_core(void)
701{ 703{
diff --git a/arch/x86/um/asm/processor.h b/arch/x86/um/asm/processor.h
index 04f82e020f2b..2a206d2b14ab 100644
--- a/arch/x86/um/asm/processor.h
+++ b/arch/x86/um/asm/processor.h
@@ -25,7 +25,8 @@ static inline void rep_nop(void)
25 __asm__ __volatile__("rep;nop": : :"memory"); 25 __asm__ __volatile__("rep;nop": : :"memory");
26} 26}
27 27
28#define cpu_relax() rep_nop() 28#define cpu_relax() rep_nop()
29#define cpu_relax_lowlatency() cpu_relax()
29 30
30#include <asm/processor-generic.h> 31#include <asm/processor-generic.h>
31 32
diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h
index abb59708a3b7..b61bdf0eea25 100644
--- a/arch/xtensa/include/asm/processor.h
+++ b/arch/xtensa/include/asm/processor.h
@@ -182,6 +182,7 @@ extern unsigned long get_wchan(struct task_struct *p);
182#define KSTK_ESP(tsk) (task_pt_regs(tsk)->areg[1]) 182#define KSTK_ESP(tsk) (task_pt_regs(tsk)->areg[1])
183 183
184#define cpu_relax() barrier() 184#define cpu_relax() barrier()
185#define cpu_relax_lowlatency() cpu_relax()
185 186
186/* Special register access. */ 187/* Special register access. */
187 188