Skip to contentSkip to conversation

spinlock: remove redundant arch_*_relax operations

PATCH RESEND In review Will Deacon 4 participants 18 messages Feb 21, 2014 – Mar 5, 2014

Subsystems (11)
Arm (32-bit) x86 MIPS arm64 +7 more subsystems
lore
Share & tools
lore
#0 lore raw

cover spinlock: remove redundant arch_*_relax operations

Hi Andrew,

I've been carrying these for ages and, whilst they're boring cosmetic changes, I'd like to get them upstream so I can forget about this series.

The commit introducing the generic change making this possible went in with c14c338cb05c ("kernel/spinlock.c: add default arch_*_relax definitions for GENERIC_LOCKBREAK") back in September.

Cheers,

Will

Will Deacon (14):
ARC: locks: remove redundant arch_*_relax operations
ARM: locks: remove redundant arch_*_relax operations
arm64: locks: remove redundant arch_*_relax operations
blackfin: locks: remove redundant arch_*_relax operations
cris: locks: remove redundant arch_*_relax operations
ia64: locks: remove redundant arch_*_relax operations
m32r: locks: remove redundant arch_*_relax operations
metag: locks: remove redundant arch_*_relax operations
mips: locks: remove redundant arch_*_relax operations
hppa: locks: remove redundant arch_*_relax operations
s390: locks: remove redundant arch_*_relax operations
sh: locks: remove redundant arch_*_relax operations
sparc: locks: remove redundant arch_*_relax operations
x86: locks: remove redundant arch_*_relax operations

 arch/arc/include/asm/spinlock.h            | 4 ----
 arch/arm/include/asm/spinlock.h            | 4 ----
 arch/arm64/include/asm/spinlock.h          | 4 ----
 arch/blackfin/include/asm/spinlock.h       | 4 ----
 arch/cris/include/arch-v32/arch/spinlock.h | 4 ----
 arch/ia64/include/asm/spinlock.h           | 4 ----
 arch/m32r/include/asm/spinlock.h           | 4 ----
 arch/metag/include/asm/spinlock.h          | 4 ----
 arch/metag/include/asm/spinlock_lnkget.h   | 7 -------
 arch/mips/include/asm/spinlock.h           | 4 ----
 arch/parisc/include/asm/spinlock.h         | 4 ----
 arch/s390/include/asm/spinlock.h           | 4 +---
 arch/sh/include/asm/spinlock.h             | 4 ----
 arch/sparc/include/asm/spinlock_32.h       | 4 ----
 arch/sparc/include/asm/spinlock_64.h       | 4 ----
 arch/x86/include/asm/spinlock.h            | 4 ----
 16 files changed, 1 insertion(+), 66 deletions(-)
Signature · 1 line
1.8.2.2
#1 lore raw

PATCH RESEND 1/14 ARC: locks: remove redundant arch_*_relax operations

Now that the arch_{spin,read,write}_relax macros default to cpu_relax(), remove the redundant definitions for ARC.

---
 arch/arc/include/asm/spinlock.h | 4 ----
 1 file changed, 4 deletions(-)
arch/arc/include/asm/spinlock.h +0 -4
index b6a8c2dfbe6e..a7211e411018 100644
@@ -144,8 +144,4 @@ static inline void arch_write_unlock(arch_rwlock_t *rw)
 #define arch_read_lock_flags(lock, flags)	arch_read_lock(lock)
 #define arch_write_lock_flags(lock, flags)	arch_write_lock(lock)
 
-#define arch_spin_relax(lock)	cpu_relax()
-#define arch_read_relax(lock)	cpu_relax()
-#define arch_write_relax(lock)	cpu_relax()
-
 #endif /* __ASM_SPINLOCK_H */
Signature · 1 line
1.8.2.2
#2 lore raw

PATCH RESEND 2/14 ARM: locks: remove redundant arch_*_relax operations

In reply to Will Deacon

Now that the arch_{spin,read,write}_relax macros default to cpu_relax(), remove the redundant definitions for ARM.

---
 arch/arm/include/asm/spinlock.h | 4 ----
 1 file changed, 4 deletions(-)
arch/arm/include/asm/spinlock.h +0 -4
index ef3c6072aa45..d97df6f68fa3 100644
@@ -289,8 +289,4 @@ static inline int arch_read_trylock(arch_rwlock_t *rw)
 #define arch_read_lock_flags(lock, flags) arch_read_lock(lock)
 #define arch_write_lock_flags(lock, flags) arch_write_lock(lock)
 
-#define arch_spin_relax(lock)	cpu_relax()
-#define arch_read_relax(lock)	cpu_relax()
-#define arch_write_relax(lock)	cpu_relax()
-
 #endif /* __ASM_SPINLOCK_H */
Signature · 1 line
1.8.2.2
#3 lore raw

PATCH RESEND 3/14 arm64: locks: remove redundant arch_*_relax operations

In reply to Will Deacon

Now that the arch_{spin,read,write}_relax macros default to cpu_relax(), remove the redundant definitions for arm64.

Cc Catalin Marinas <[email protected]>
---
 arch/arm64/include/asm/spinlock.h | 4 ----
 1 file changed, 4 deletions(-)
arch/arm64/include/asm/spinlock.h +0 -4
index 3d5cf064d7a1..96f73f1302ff 100644
@@ -227,8 +227,4 @@ static inline int arch_read_trylock(arch_rwlock_t *rw)
 #define arch_read_lock_flags(lock, flags) arch_read_lock(lock)
 #define arch_write_lock_flags(lock, flags) arch_write_lock(lock)
 
-#define arch_spin_relax(lock)	cpu_relax()
-#define arch_read_relax(lock)	cpu_relax()
-#define arch_write_relax(lock)	cpu_relax()
-
 #endif /* __ASM_SPINLOCK_H */
Signature · 1 line
1.8.2.2
#5 lore raw

PATCH RESEND 4/14 blackfin: locks: remove redundant arch_*_relax operations

In reply to Will Deacon

Now that the arch_{spin,read,write}_relax macros default to cpu_relax(), remove the redundant definitions for Blackfin.

Cc Mike Frysinger <[email protected]>
---
 arch/blackfin/include/asm/spinlock.h | 4 ----
 1 file changed, 4 deletions(-)
arch/blackfin/include/asm/spinlock.h +0 -4
index 490c7caa02d9..8c58ddaec369 100644
@@ -96,10 +96,6 @@ static inline void arch_write_unlock(arch_rwlock_t *rw)
 	__raw_write_unlock_asm(&rw->lock);
 }
 
-#define arch_spin_relax(lock)  	cpu_relax()
-#define arch_read_relax(lock)	cpu_relax()
-#define arch_write_relax(lock)	cpu_relax()
-
 #endif
 
 #endif /*  !__BFIN_SPINLOCK_H */
Signature · 1 line
1.8.2.2
#6 lore raw

PATCH RESEND 5/14 cris: locks: remove redundant arch_*_relax operations

In reply to Will Deacon

Now that the arch_{spin,read,write}_relax macros default to cpu_relax(), remove the redundant definitions for Cris.

---
 arch/cris/include/arch-v32/arch/spinlock.h | 4 ----
 1 file changed, 4 deletions(-)
arch/cris/include/arch-v32/arch/spinlock.h +0 -4
index f13275522f4d..bf94cc6bd9b4 100644
@@ -124,8 +124,4 @@ static  inline int arch_write_trylock(arch_rwlock_t *rw)
 #define _raw_read_lock_flags(lock, flags) _raw_read_lock(lock)
 #define _raw_write_lock_flags(lock, flags) _raw_write_lock(lock)
 
-#define arch_spin_relax(lock)	cpu_relax()
-#define arch_read_relax(lock)	cpu_relax()
-#define arch_write_relax(lock)	cpu_relax()
-
 #endif /* __ASM_ARCH_SPINLOCK_H */
Signature · 1 line
1.8.2.2
#7 lore raw

PATCH RESEND 6/14 ia64: locks: remove redundant arch_*_relax operations

In reply to Will Deacon

Now that the arch_{spin,read,write}_relax macros default to cpu_relax(), remove the redundant definitions for Itanium.

---
 arch/ia64/include/asm/spinlock.h | 4 ----
 1 file changed, 4 deletions(-)
arch/ia64/include/asm/spinlock.h +0 -4
index 45698cd15b7b..0110413d89c0 100644
@@ -289,8 +289,4 @@ static inline int arch_read_trylock(arch_rwlock_t *x)
 	return (u32)ia64_cmpxchg4_acq((__u32 *)(x), new.word, old.word) == old.word;
 }
 
-#define arch_spin_relax(lock)	cpu_relax()
-#define arch_read_relax(lock)	cpu_relax()
-#define arch_write_relax(lock)	cpu_relax()
-
 #endif /*  _ASM_IA64_SPINLOCK_H */
Signature · 1 line
1.8.2.2
#8 lore raw

PATCH RESEND 7/14 m32r: locks: remove redundant arch_*_relax operations

In reply to Will Deacon

Now that the arch_{spin,read,write}_relax macros default to cpu_relax(), remove the redundant definitions for m32r.

Cc Hirokazu Takata <[email protected]>
---
 arch/m32r/include/asm/spinlock.h | 4 ----
 1 file changed, 4 deletions(-)
arch/m32r/include/asm/spinlock.h +0 -4
index fa13694eaae3..3112249ebee4 100644
@@ -320,8 +320,4 @@ static inline int arch_write_trylock(arch_rwlock_t *lock)
 #define arch_read_lock_flags(lock, flags) arch_read_lock(lock)
 #define arch_write_lock_flags(lock, flags) arch_write_lock(lock)
 
-#define arch_spin_relax(lock)	cpu_relax()
-#define arch_read_relax(lock)	cpu_relax()
-#define arch_write_relax(lock)	cpu_relax()
-
 #endif	/* _ASM_M32R_SPINLOCK_H */
Signature · 1 line
1.8.2.2
#9 lore raw

PATCH RESEND 8/14 metag: locks: remove redundant arch_*_relax operations

In reply to Will Deacon

Now that the arch_{spin,read,write}_relax macros default to cpu_relax(), remove the redundant definitions for metag. This patch also removes the duplicate definitions of arch_{read,write}_lock_flags.

---
 arch/metag/include/asm/spinlock.h        | 4 ----
 arch/metag/include/asm/spinlock_lnkget.h | 7 -------
 2 files changed, 11 deletions(-)
arch/metag/include/asm/spinlock.h +0 -4
index 86a7cf3d1386..15cf4ff57f74 100644
@@ -15,8 +15,4 @@
 #define	arch_read_lock_flags(lock, flags) arch_read_lock(lock)
 #define	arch_write_lock_flags(lock, flags) arch_write_lock(lock)
 
-#define arch_spin_relax(lock)	cpu_relax()
-#define arch_read_relax(lock)	cpu_relax()
-#define arch_write_relax(lock)	cpu_relax()
-
 #endif /* __ASM_SPINLOCK_H */
arch/metag/include/asm/spinlock_lnkget.h +0 -7
index ad8436feed8d..73d034596c18 100644
@@ -239,11 +239,4 @@ static inline int arch_read_can_lock(arch_rwlock_t *rw)
 	return tmp;
 }
 
-#define	arch_read_lock_flags(lock, flags) arch_read_lock(lock)
-#define	arch_write_lock_flags(lock, flags) arch_write_lock(lock)
-
-#define arch_spin_relax(lock)	cpu_relax()
-#define arch_read_relax(lock)	cpu_relax()
-#define arch_write_relax(lock)	cpu_relax()
-
 #endif /* __ASM_SPINLOCK_LNKGET_H */
Signature · 1 line
1.8.2.2
#10 lore raw

PATCH RESEND 9/14 mips: locks: remove redundant arch_*_relax operations

In reply to Will Deacon

Now that the arch_{spin,read,write}_relax macros default to cpu_relax(), remove the redundant definitions for MIPS.

---
 arch/mips/include/asm/spinlock.h | 4 ----
 1 file changed, 4 deletions(-)
arch/mips/include/asm/spinlock.h +0 -4
index 78d201fb6c87..7bd850a15302 100644
@@ -419,8 +419,4 @@ static inline int arch_write_trylock(arch_rwlock_t *rw)
 #define arch_read_lock_flags(lock, flags) arch_read_lock(lock)
 #define arch_write_lock_flags(lock, flags) arch_write_lock(lock)
 
-#define arch_spin_relax(lock)	cpu_relax()
-#define arch_read_relax(lock)	cpu_relax()
-#define arch_write_relax(lock)	cpu_relax()
-
 #endif /* _ASM_SPINLOCK_H */
Signature · 1 line
1.8.2.2
#11 lore raw

PATCH RESEND 10/14 hppa: locks: remove redundant arch_*_relax operations

In reply to Will Deacon

Now that the arch_{spin,read,write}_relax macros default to cpu_relax(), remove the redundant definitions for parisc.

---
 arch/parisc/include/asm/spinlock.h | 4 ----
 1 file changed, 4 deletions(-)
arch/parisc/include/asm/spinlock.h +0 -4
index 3516e0b27044..64f2992e439f 100644
@@ -191,8 +191,4 @@ static __inline__ int arch_write_can_lock(arch_rwlock_t *rw)
 #define arch_read_lock_flags(lock, flags) arch_read_lock(lock)
 #define arch_write_lock_flags(lock, flags) arch_write_lock(lock)
 
-#define arch_spin_relax(lock)	cpu_relax()
-#define arch_read_relax(lock)	cpu_relax()
-#define arch_write_relax(lock)	cpu_relax()
-
 #endif /* __ASM_SPINLOCK_H */
Signature · 1 line
1.8.2.2
maintainer
#12 lore raw

PATCH RESEND 10/14 hppa: locks: remove redundant arch_*_relax operations

Forwarding to parisc patchwork...

-------- Original Message --------
Subject: [PATCH RESEND 10/14] hppa: locks: remove redundant arch_*_relax operations
Date: Fri, 21 Feb 2014 17:34:57 +0000
From: Will Deacon <[email protected]>
To: [email protected]
CC: [email protected], Will Deacon <[email protected]>, Helge Deller <[email protected]>

Now that the arch_{spin,read,write}_relax macros default to cpu_relax(), remove the redundant definitions for parisc.

---
 arch/parisc/include/asm/spinlock.h | 4 ----
 1 file changed, 4 deletions(-)
arch/parisc/include/asm/spinlock.h +0 -3
index 3516e0b27044..64f2992e439f 100644
@@ -191,8 +191,4 @@ static __inline__ int arch_write_can_lock(arch_rwlock_t *rw)
 #define arch_read_lock_flags(lock, flags) arch_read_lock(lock)
 #define arch_write_lock_flags(lock, flags) arch_write_lock(lock)
 
-#define arch_spin_relax(lock)	cpu_relax()
-#define arch_read_relax(lock)	cpu_relax()
-#define arch_write_relax(lock)	cpu_relax()
#13 lore raw

PATCH RESEND 11/14 s390: locks: remove redundant arch_*_relax operations

In reply to Will Deacon

Now that the arch_{read,write}_relax macros default to cpu_relax(), remove the redundant definitions for S390.

Since S390 provides an arch_spin_relax implementation, that function is left alone and additionally defined as a macro, so the LOCKBREAK code will pick it up.

Cc Martin Schwidefsky <[email protected]>
---
 arch/s390/include/asm/spinlock.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/s390/include/asm/spinlock.h +1 -3
index 83e5d216105e..9ddf6c8ff9dd 100644
@@ -43,6 +43,7 @@ extern void arch_spin_lock_wait(arch_spinlock_t *);
 extern void arch_spin_lock_wait_flags(arch_spinlock_t *, unsigned long flags);
 extern int arch_spin_trylock_retry(arch_spinlock_t *);
 extern void arch_spin_relax(arch_spinlock_t *lock);
+#define arch_spin_relax arch_spin_relax
 
 static inline int arch_spin_value_unlocked(arch_spinlock_t lock)
 {
@@ -175,7 +176,4 @@ static inline int arch_write_trylock(arch_rwlock_t *rw)
 	return _raw_write_trylock_retry(rw);
 }
 
-#define arch_read_relax(lock)	cpu_relax()
-#define arch_write_relax(lock)	cpu_relax()
-
 #endif /* __ASM_SPINLOCK_H */
Signature · 1 line
1.8.2.2
#14 lore raw

PATCH RESEND 12/14 sh: locks: remove redundant arch_*_relax operations

In reply to Will Deacon

Now that the arch_{spin,read,write}_relax macros default to cpu_relax(), remove the redundant definitions for SuperH.

---
 arch/sh/include/asm/spinlock.h | 4 ----
 1 file changed, 4 deletions(-)
arch/sh/include/asm/spinlock.h +0 -4
index bdc0f3b6c56a..a89820dc6d9e 100644
@@ -219,8 +219,4 @@ static inline int arch_write_trylock(arch_rwlock_t *rw)
 #define arch_read_lock_flags(lock, flags) arch_read_lock(lock)
 #define arch_write_lock_flags(lock, flags) arch_write_lock(lock)
 
-#define arch_spin_relax(lock)	cpu_relax()
-#define arch_read_relax(lock)	cpu_relax()
-#define arch_write_relax(lock)	cpu_relax()
-
 #endif /* __ASM_SH_SPINLOCK_H */
Signature · 1 line
1.8.2.2
#15 lore raw

PATCH RESEND 13/14 sparc: locks: remove redundant arch_*_relax operations

In reply to Will Deacon

Now that the arch_{spin,read,write}_relax macros default to cpu_relax(), remove the redundant definitions for Sparc.

---
 arch/sparc/include/asm/spinlock_32.h | 4 ----
 arch/sparc/include/asm/spinlock_64.h | 4 ----
 2 files changed, 8 deletions(-)
arch/sparc/include/asm/spinlock_32.h +0 -4
index bcc98fc35281..180c8f3462ea 100644
@@ -188,10 +188,6 @@ static inline int __arch_read_trylock(arch_rwlock_t *rw)
 #define arch_read_lock_flags(rw, flags)   arch_read_lock(rw)
 #define arch_write_lock_flags(rw, flags)  arch_write_lock(rw)
 
-#define arch_spin_relax(lock)	cpu_relax()
-#define arch_read_relax(lock)	cpu_relax()
-#define arch_write_relax(lock)	cpu_relax()
-
 #define arch_read_can_lock(rw) (!((rw)->lock & 0xff))
 #define arch_write_can_lock(rw) (!(rw)->lock)
 
arch/sparc/include/asm/spinlock_64.h +0 -4
index 968917694978..f3b7a884f99e 100644
@@ -216,10 +216,6 @@ static int inline arch_write_trylock(arch_rwlock_t *lock)
 #define arch_read_can_lock(rw)		(!((rw)->lock & 0x80000000UL))
 #define arch_write_can_lock(rw)	(!(rw)->lock)
 
-#define arch_spin_relax(lock)	cpu_relax()
-#define arch_read_relax(lock)	cpu_relax()
-#define arch_write_relax(lock)	cpu_relax()
-
 #endif /* !(__ASSEMBLY__) */
 
 #endif /* !(__SPARC64_SPINLOCK_H) */
Signature · 1 line
1.8.2.2
#16 lore raw

PATCH RESEND 14/14 x86: locks: remove redundant arch_*_relax operations

In reply to Will Deacon

Now that the arch_{spin,read,write}_relax macros default to cpu_relax(), remove the redundant definitions for x86.

---
 arch/x86/include/asm/spinlock.h | 4 ----
 1 file changed, 4 deletions(-)
arch/x86/include/asm/spinlock.h +0 -4
index bf156ded74b5..221ab49182c4 100644
@@ -280,8 +280,4 @@ static inline void arch_write_unlock(arch_rwlock_t *rw)
 #undef WRITE_LOCK_SUB
 #undef WRITE_LOCK_CMP
 
-#define arch_spin_relax(lock)	cpu_relax()
-#define arch_read_relax(lock)	cpu_relax()
-#define arch_write_relax(lock)	cpu_relax()
-
 #endif /* _ASM_X86_SPINLOCK_H */
Signature · 1 line
1.8.2.2
reviewer Acked-by on v1 14/14
#17 lore raw

Re: [PATCH RESEND 14/14] x86: locks: remove redundant arch_*_relax operations

Quoted 7 lines · Will Deacon

Now that the arch_{spin,read,write}_relax macros default to cpu_relax(), remove the redundant definitions for x86.