diff options
author | Will Deacon <will.deacon@arm.com> | 2017-10-03 14:25:28 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-10-10 05:50:18 -0400 |
commit | 0160fb177d484367e041ac251fca591a3e49660c (patch) | |
tree | c573a5a80bc6c62a0bcbbeb31be3b121367c3a2b | |
parent | a8a217c22116eff6c120d753c9934089fb229af0 (diff) |
locking/arch: Remove dummy arch_{read,spin,write}_relax() implementations
arch_{read,spin,write}_relax() are defined as cpu_relax() by the core
code, so architectures that can't do better (i.e. most of them) don't
need to bother with the dummy definitions.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: paulmck@linux.vnet.ibm.com
Link: http://lkml.kernel.org/r/1507055129-12300-3-git-send-email-will.deacon@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/arc/include/asm/spinlock.h | 4 | ||||
-rw-r--r-- | arch/arm/include/asm/spinlock.h | 4 | ||||
-rw-r--r-- | arch/arm64/include/asm/spinlock.h | 4 | ||||
-rw-r--r-- | arch/blackfin/include/asm/spinlock.h | 4 | ||||
-rw-r--r-- | arch/ia64/include/asm/spinlock.h | 4 | ||||
-rw-r--r-- | arch/m32r/include/asm/spinlock.h | 4 | ||||
-rw-r--r-- | arch/metag/include/asm/spinlock.h | 4 | ||||
-rw-r--r-- | arch/metag/include/asm/spinlock_lnkget.h | 4 | ||||
-rw-r--r-- | arch/mips/include/asm/spinlock.h | 4 | ||||
-rw-r--r-- | arch/s390/include/asm/spinlock.h | 3 | ||||
-rw-r--r-- | arch/sh/include/asm/spinlock-cas.h | 4 | ||||
-rw-r--r-- | arch/sh/include/asm/spinlock-llsc.h | 4 | ||||
-rw-r--r-- | arch/sparc/include/asm/spinlock_32.h | 4 | ||||
-rw-r--r-- | arch/sparc/include/asm/spinlock_64.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/spinlock.h | 4 |
15 files changed, 3 insertions, 56 deletions
diff --git a/arch/arc/include/asm/spinlock.h b/arch/arc/include/asm/spinlock.h index ce9bfcf1d870..f85bb585cdfc 100644 --- a/arch/arc/include/asm/spinlock.h +++ b/arch/arc/include/asm/spinlock.h | |||
@@ -413,8 +413,4 @@ static inline void arch_write_unlock(arch_rwlock_t *rw) | |||
413 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) | 413 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) |
414 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) | 414 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) |
415 | 415 | ||
416 | #define arch_spin_relax(lock) cpu_relax() | ||
417 | #define arch_read_relax(lock) cpu_relax() | ||
418 | #define arch_write_relax(lock) cpu_relax() | ||
419 | |||
420 | #endif /* __ASM_SPINLOCK_H */ | 416 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h index f5223260c73e..d40a28fcbc62 100644 --- a/arch/arm/include/asm/spinlock.h +++ b/arch/arm/include/asm/spinlock.h | |||
@@ -273,8 +273,4 @@ static inline int arch_read_trylock(arch_rwlock_t *rw) | |||
273 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) | 273 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) |
274 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) | 274 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) |
275 | 275 | ||
276 | #define arch_spin_relax(lock) cpu_relax() | ||
277 | #define arch_read_relax(lock) cpu_relax() | ||
278 | #define arch_write_relax(lock) cpu_relax() | ||
279 | |||
280 | #endif /* __ASM_SPINLOCK_H */ | 276 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/arch/arm64/include/asm/spinlock.h b/arch/arm64/include/asm/spinlock.h index 95ad7102b63c..1504f2b95c57 100644 --- a/arch/arm64/include/asm/spinlock.h +++ b/arch/arm64/include/asm/spinlock.h | |||
@@ -306,10 +306,6 @@ static inline int arch_read_trylock(arch_rwlock_t *rw) | |||
306 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) | 306 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) |
307 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) | 307 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) |
308 | 308 | ||
309 | #define arch_spin_relax(lock) cpu_relax() | ||
310 | #define arch_read_relax(lock) cpu_relax() | ||
311 | #define arch_write_relax(lock) cpu_relax() | ||
312 | |||
313 | /* See include/linux/spinlock.h */ | 309 | /* See include/linux/spinlock.h */ |
314 | #define smp_mb__after_spinlock() smp_mb() | 310 | #define smp_mb__after_spinlock() smp_mb() |
315 | 311 | ||
diff --git a/arch/blackfin/include/asm/spinlock.h b/arch/blackfin/include/asm/spinlock.h index 607ef98c0f6c..3885d12d9939 100644 --- a/arch/blackfin/include/asm/spinlock.h +++ b/arch/blackfin/include/asm/spinlock.h | |||
@@ -82,10 +82,6 @@ static inline void arch_write_unlock(arch_rwlock_t *rw) | |||
82 | __raw_write_unlock_asm(&rw->lock); | 82 | __raw_write_unlock_asm(&rw->lock); |
83 | } | 83 | } |
84 | 84 | ||
85 | #define arch_spin_relax(lock) cpu_relax() | ||
86 | #define arch_read_relax(lock) cpu_relax() | ||
87 | #define arch_write_relax(lock) cpu_relax() | ||
88 | |||
89 | #endif | 85 | #endif |
90 | 86 | ||
91 | #endif /* !__BFIN_SPINLOCK_H */ | 87 | #endif /* !__BFIN_SPINLOCK_H */ |
diff --git a/arch/ia64/include/asm/spinlock.h b/arch/ia64/include/asm/spinlock.h index c728dda59bd2..ed1e6212e9de 100644 --- a/arch/ia64/include/asm/spinlock.h +++ b/arch/ia64/include/asm/spinlock.h | |||
@@ -269,8 +269,4 @@ static inline int arch_read_trylock(arch_rwlock_t *x) | |||
269 | return (u32)ia64_cmpxchg4_acq((__u32 *)(x), new.word, old.word) == old.word; | 269 | return (u32)ia64_cmpxchg4_acq((__u32 *)(x), new.word, old.word) == old.word; |
270 | } | 270 | } |
271 | 271 | ||
272 | #define arch_spin_relax(lock) cpu_relax() | ||
273 | #define arch_read_relax(lock) cpu_relax() | ||
274 | #define arch_write_relax(lock) cpu_relax() | ||
275 | |||
276 | #endif /* _ASM_IA64_SPINLOCK_H */ | 272 | #endif /* _ASM_IA64_SPINLOCK_H */ |
diff --git a/arch/m32r/include/asm/spinlock.h b/arch/m32r/include/asm/spinlock.h index 002601371b2f..6809a9bbd169 100644 --- a/arch/m32r/include/asm/spinlock.h +++ b/arch/m32r/include/asm/spinlock.h | |||
@@ -308,8 +308,4 @@ static inline int arch_write_trylock(arch_rwlock_t *lock) | |||
308 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) | 308 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) |
309 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) | 309 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) |
310 | 310 | ||
311 | #define arch_spin_relax(lock) cpu_relax() | ||
312 | #define arch_read_relax(lock) cpu_relax() | ||
313 | #define arch_write_relax(lock) cpu_relax() | ||
314 | |||
315 | #endif /* _ASM_M32R_SPINLOCK_H */ | 311 | #endif /* _ASM_M32R_SPINLOCK_H */ |
diff --git a/arch/metag/include/asm/spinlock.h b/arch/metag/include/asm/spinlock.h index ddf7fe5708a6..b5b4174cde5e 100644 --- a/arch/metag/include/asm/spinlock.h +++ b/arch/metag/include/asm/spinlock.h | |||
@@ -20,8 +20,4 @@ | |||
20 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) | 20 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) |
21 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) | 21 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) |
22 | 22 | ||
23 | #define arch_spin_relax(lock) cpu_relax() | ||
24 | #define arch_read_relax(lock) cpu_relax() | ||
25 | #define arch_write_relax(lock) cpu_relax() | ||
26 | |||
27 | #endif /* __ASM_SPINLOCK_H */ | 23 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/arch/metag/include/asm/spinlock_lnkget.h b/arch/metag/include/asm/spinlock_lnkget.h index 6a932a952d53..d5c334ddfd62 100644 --- a/arch/metag/include/asm/spinlock_lnkget.h +++ b/arch/metag/include/asm/spinlock_lnkget.h | |||
@@ -212,8 +212,4 @@ static inline int arch_read_trylock(arch_rwlock_t *rw) | |||
212 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) | 212 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) |
213 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) | 213 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) |
214 | 214 | ||
215 | #define arch_spin_relax(lock) cpu_relax() | ||
216 | #define arch_read_relax(lock) cpu_relax() | ||
217 | #define arch_write_relax(lock) cpu_relax() | ||
218 | |||
219 | #endif /* __ASM_SPINLOCK_LNKGET_H */ | 215 | #endif /* __ASM_SPINLOCK_LNKGET_H */ |
diff --git a/arch/mips/include/asm/spinlock.h b/arch/mips/include/asm/spinlock.h index a7d21da16b6a..4260d3f80d3a 100644 --- a/arch/mips/include/asm/spinlock.h +++ b/arch/mips/include/asm/spinlock.h | |||
@@ -16,8 +16,4 @@ | |||
16 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) | 16 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) |
17 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) | 17 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) |
18 | 18 | ||
19 | #define arch_spin_relax(lock) cpu_relax() | ||
20 | #define arch_read_relax(lock) cpu_relax() | ||
21 | #define arch_write_relax(lock) cpu_relax() | ||
22 | |||
23 | #endif /* _ASM_SPINLOCK_H */ | 19 | #endif /* _ASM_SPINLOCK_H */ |
diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h index dc9c58ed9e4c..4eca60cc81e4 100644 --- a/arch/s390/include/asm/spinlock.h +++ b/arch/s390/include/asm/spinlock.h | |||
@@ -45,6 +45,7 @@ static inline void arch_spin_relax(arch_spinlock_t *lock) | |||
45 | { | 45 | { |
46 | arch_lock_relax(lock->lock); | 46 | arch_lock_relax(lock->lock); |
47 | } | 47 | } |
48 | #define arch_spin_relax arch_spin_relax | ||
48 | 49 | ||
49 | static inline u32 arch_spin_lockval(int cpu) | 50 | static inline u32 arch_spin_lockval(int cpu) |
50 | { | 51 | { |
@@ -256,10 +257,12 @@ static inline void arch_read_relax(arch_rwlock_t *rw) | |||
256 | { | 257 | { |
257 | arch_lock_relax(rw->owner); | 258 | arch_lock_relax(rw->owner); |
258 | } | 259 | } |
260 | #define arch_read_relax arch_read_relax | ||
259 | 261 | ||
260 | static inline void arch_write_relax(arch_rwlock_t *rw) | 262 | static inline void arch_write_relax(arch_rwlock_t *rw) |
261 | { | 263 | { |
262 | arch_lock_relax(rw->owner); | 264 | arch_lock_relax(rw->owner); |
263 | } | 265 | } |
266 | #define arch_write_relax arch_write_relax | ||
264 | 267 | ||
265 | #endif /* __ASM_SPINLOCK_H */ | 268 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/arch/sh/include/asm/spinlock-cas.h b/arch/sh/include/asm/spinlock-cas.h index 315467834521..295993c2598e 100644 --- a/arch/sh/include/asm/spinlock-cas.h +++ b/arch/sh/include/asm/spinlock-cas.h | |||
@@ -93,8 +93,4 @@ static inline int arch_write_trylock(arch_rwlock_t *rw) | |||
93 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) | 93 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) |
94 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) | 94 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) |
95 | 95 | ||
96 | #define arch_spin_relax(lock) cpu_relax() | ||
97 | #define arch_read_relax(lock) cpu_relax() | ||
98 | #define arch_write_relax(lock) cpu_relax() | ||
99 | |||
100 | #endif /* __ASM_SH_SPINLOCK_CAS_H */ | 96 | #endif /* __ASM_SH_SPINLOCK_CAS_H */ |
diff --git a/arch/sh/include/asm/spinlock-llsc.h b/arch/sh/include/asm/spinlock-llsc.h index 06be4a55f3c4..a6f9edd15317 100644 --- a/arch/sh/include/asm/spinlock-llsc.h +++ b/arch/sh/include/asm/spinlock-llsc.h | |||
@@ -200,8 +200,4 @@ static inline int arch_write_trylock(arch_rwlock_t *rw) | |||
200 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) | 200 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) |
201 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) | 201 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) |
202 | 202 | ||
203 | #define arch_spin_relax(lock) cpu_relax() | ||
204 | #define arch_read_relax(lock) cpu_relax() | ||
205 | #define arch_write_relax(lock) cpu_relax() | ||
206 | |||
207 | #endif /* __ASM_SH_SPINLOCK_LLSC_H */ | 203 | #endif /* __ASM_SH_SPINLOCK_LLSC_H */ |
diff --git a/arch/sparc/include/asm/spinlock_32.h b/arch/sparc/include/asm/spinlock_32.h index 76986b8f7dad..9d9129efd5d6 100644 --- a/arch/sparc/include/asm/spinlock_32.h +++ b/arch/sparc/include/asm/spinlock_32.h | |||
@@ -186,10 +186,6 @@ static inline int __arch_read_trylock(arch_rwlock_t *rw) | |||
186 | #define arch_read_lock_flags(rw, flags) arch_read_lock(rw) | 186 | #define arch_read_lock_flags(rw, flags) arch_read_lock(rw) |
187 | #define arch_write_lock_flags(rw, flags) arch_write_lock(rw) | 187 | #define arch_write_lock_flags(rw, flags) arch_write_lock(rw) |
188 | 188 | ||
189 | #define arch_spin_relax(lock) cpu_relax() | ||
190 | #define arch_read_relax(lock) cpu_relax() | ||
191 | #define arch_write_relax(lock) cpu_relax() | ||
192 | |||
193 | #endif /* !(__ASSEMBLY__) */ | 189 | #endif /* !(__ASSEMBLY__) */ |
194 | 190 | ||
195 | #endif /* __SPARC_SPINLOCK_H */ | 191 | #endif /* __SPARC_SPINLOCK_H */ |
diff --git a/arch/sparc/include/asm/spinlock_64.h b/arch/sparc/include/asm/spinlock_64.h index f7028f5e1a5a..3b67705e1b74 100644 --- a/arch/sparc/include/asm/spinlock_64.h +++ b/arch/sparc/include/asm/spinlock_64.h | |||
@@ -16,10 +16,6 @@ | |||
16 | #define arch_read_lock_flags(p, f) arch_read_lock(p) | 16 | #define arch_read_lock_flags(p, f) arch_read_lock(p) |
17 | #define arch_write_lock_flags(p, f) arch_write_lock(p) | 17 | #define arch_write_lock_flags(p, f) arch_write_lock(p) |
18 | 18 | ||
19 | #define arch_spin_relax(lock) cpu_relax() | ||
20 | #define arch_read_relax(lock) cpu_relax() | ||
21 | #define arch_write_relax(lock) cpu_relax() | ||
22 | |||
23 | #endif /* !(__ASSEMBLY__) */ | 19 | #endif /* !(__ASSEMBLY__) */ |
24 | 20 | ||
25 | #endif /* !(__SPARC64_SPINLOCK_H) */ | 21 | #endif /* !(__SPARC64_SPINLOCK_H) */ |
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h index 6d391909e864..a558c187f20c 100644 --- a/arch/x86/include/asm/spinlock.h +++ b/arch/x86/include/asm/spinlock.h | |||
@@ -44,8 +44,4 @@ | |||
44 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) | 44 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) |
45 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) | 45 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) |
46 | 46 | ||
47 | #define arch_spin_relax(lock) cpu_relax() | ||
48 | #define arch_read_relax(lock) cpu_relax() | ||
49 | #define arch_write_relax(lock) cpu_relax() | ||
50 | |||
51 | #endif /* _ASM_X86_SPINLOCK_H */ | 47 | #endif /* _ASM_X86_SPINLOCK_H */ |