path: root/arch/score/include
diff options
authorDavidlohr Bueso <>2014-06-29 15:09:33 -0700
committerIngo Molnar <>2014-07-17 12:32:47 +0200
commit3a6bfbc91df04b081a44d419e0260bad54abddf7 (patch)
treef83d654657f75f565b11619a3e7211554ac5cb47 /arch/score/include
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 <> Signed-off-by: Peter Zijlstra <> Cc: Andrew Morton <> Cc: Anton Blanchard <> Cc: Aurelien Jacquiot <> Cc: Benjamin Herrenschmidt <> Cc: Bharat Bhushan <> Cc: Catalin Marinas <> Cc: Chen Liqin <> Cc: Chris Metcalf <> Cc: Christian Borntraeger <> Cc: Chris Zankel <> Cc: David Howells <> Cc: David S. Miller <> Cc: Deepthi Dharwar <> Cc: Dominik Dingel <> Cc: Fenghua Yu <> Cc: Geert Uytterhoeven <> Cc: Guan Xuetao <> Cc: Haavard Skinnemoen <> Cc: Hans-Christian Egtvedt <> Cc: Heiko Carstens <> Cc: Helge Deller <> Cc: Hirokazu Takata <> Cc: Ivan Kokshaysky <> Cc: James E.J. Bottomley <> Cc: James Hogan <> Cc: Jason Wang <> Cc: Jesper Nilsson <> Cc: Joe Perches <> Cc: Jonas Bonn <> Cc: Joseph Myers <> Cc: Kees Cook <> Cc: Koichi Yasutake <> Cc: Lennox Wu <> Cc: Linus Torvalds <> Cc: Mark Salter <> Cc: Martin Schwidefsky <> Cc: Matt Turner <> Cc: Max Filippov <> Cc: Michael Neuling <> Cc: Michal Simek <> Cc: Mikael Starvik <> Cc: Nicolas Pitre <> Cc: Paolo Bonzini <> Cc: Paul Burton <> Cc: Paul E. McKenney <> Cc: Paul Gortmaker <> Cc: Paul Mackerras <> Cc: Qais Yousef <> Cc: Qiaowei Ren <> Cc: Rafael Wysocki <> Cc: Ralf Baechle <> Cc: Richard Henderson <> Cc: Richard Kuo <> Cc: Russell King <> Cc: Steven Miao <> Cc: Steven Rostedt <> Cc: Stratos Karafotis <> Cc: Tim Chen <> Cc: Tony Luck <> Cc: Vasily Kulikov <> Cc: Vineet Gupta <> Cc: Vineet Gupta <> Cc: Waiman Long <> Cc: Will Deacon <> Cc: Wolfram Sang <> Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Cc: Link: Signed-off-by: Ingo Molnar <>
Diffstat (limited to 'arch/score/include')
1 files changed, 1 insertions, 0 deletions
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);
#define current_text_addr() ({ __label__ _l; _l: &&_l; })
#define cpu_relax() barrier()
+#define cpu_relax_lowlatency() cpu_relax()
#define release_thread(thread) do {} while (0)