aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>2015-03-02 14:19:14 -0500
committerWill Deacon <will.deacon@arm.com>2015-03-17 06:17:29 -0400
commit1baa82f48030f38d1895301f1ec93acbcb3d15db (patch)
tree7d9e69cd915039f5fd62036351a4d78ad955b89c /arch
parent06e5801b8cb3fc057d88cb4dc03c0b64b2744cda (diff)
arm64: Implement cpu_relax as yield
ARM64 has the yield nop hint which has the intended semantics of cpu_relax. Implement. The immediate application is ARM CPU emulators. An emulator can take advantage of the yield hint to de-prioritise an emulated CPU in favor of other emulation tasks. QEMU A64 SMP emulation has yield awareness, and sees a significant boot time performance increase with this change. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/include/asm/processor.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
index 20e9591a60cf..d2c37a1df0eb 100644
--- a/arch/arm64/include/asm/processor.h
+++ b/arch/arm64/include/asm/processor.h
@@ -127,7 +127,11 @@ extern void release_thread(struct task_struct *);
127 127
128unsigned long get_wchan(struct task_struct *p); 128unsigned long get_wchan(struct task_struct *p);
129 129
130#define cpu_relax() barrier() 130static inline void cpu_relax(void)
131{
132 asm volatile("yield" ::: "memory");
133}
134
131#define cpu_relax_lowlatency() cpu_relax() 135#define cpu_relax_lowlatency() cpu_relax()
132 136
133/* Thread switching */ 137/* Thread switching */