* [RFC PATCH 01/16] alpha: locks: remove unused arch_*_relax operations
2013-06-21 17:17 [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
@ 2013-06-21 17:17 ` Will Deacon
2013-06-21 17:17 ` [RFC PATCH 02/16] arc: " Will Deacon
` (15 subsequent siblings)
16 siblings, 0 replies; 28+ messages in thread
From: Will Deacon @ 2013-06-21 17:17 UTC (permalink / raw)
To: linux-arch; +Cc: Will Deacon, Matt Turner, Al Viro
The arch_{spin,read,write}_relax macros are not used anywhere in the
kernel and are typically just aliases for cpu_relax().
This patch removes the unused definitions for Alpha.
Cc: Matt Turner <mattst88@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/alpha/include/asm/spinlock.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/alpha/include/asm/spinlock.h b/arch/alpha/include/asm/spinlock.h
index 3bba21e..37b570d 100644
--- a/arch/alpha/include/asm/spinlock.h
+++ b/arch/alpha/include/asm/spinlock.h
@@ -168,8 +168,4 @@ static inline void arch_write_unlock(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 /* _ALPHA_SPINLOCK_H */
--
1.8.2.2
^ permalink raw reply related [flat|nested] 28+ messages in thread* [RFC PATCH 02/16] arc: locks: remove unused arch_*_relax operations
2013-06-21 17:17 [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
2013-06-21 17:17 ` [RFC PATCH 01/16] alpha: locks: remove unused arch_*_relax operations Will Deacon
@ 2013-06-21 17:17 ` Will Deacon
2013-06-24 4:12 ` Vineet Gupta
2013-06-21 17:17 ` [RFC PATCH 03/16] ARM: " Will Deacon
` (14 subsequent siblings)
16 siblings, 1 reply; 28+ messages in thread
From: Will Deacon @ 2013-06-21 17:17 UTC (permalink / raw)
To: linux-arch; +Cc: Will Deacon, Vineet Gupta
The arch_{spin,read,write}_relax macros are not used anywhere in the
kernel and are typically just aliases for cpu_relax().
This patch removes the unused definitions for Arc.
Cc: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arc/include/asm/spinlock.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/arc/include/asm/spinlock.h b/arch/arc/include/asm/spinlock.h
index f158197..fddced5 100644
--- a/arch/arc/include/asm/spinlock.h
+++ b/arch/arc/include/asm/spinlock.h
@@ -137,8 +137,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 */
--
1.8.2.2
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [RFC PATCH 02/16] arc: locks: remove unused arch_*_relax operations
2013-06-21 17:17 ` [RFC PATCH 02/16] arc: " Will Deacon
@ 2013-06-24 4:12 ` Vineet Gupta
2013-06-24 8:58 ` Will Deacon
0 siblings, 1 reply; 28+ messages in thread
From: Vineet Gupta @ 2013-06-24 4:12 UTC (permalink / raw)
To: Will Deacon; +Cc: linux-arch
Hi Will,
On 06/21/2013 10:47 PM, Will Deacon wrote:
> The arch_{spin,read,write}_relax macros are not used anywhere in the
> kernel and are typically just aliases for cpu_relax().
>
> This patch removes the unused definitions for Arc.
For consistency sake, can you please uppercase to ARC in changelog above. Same
goes for arc prefix in patch subject.
>
> Cc: Vineet Gupta <vgupta@synopsys.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Thx,
-Vineet
> ---
> arch/arc/include/asm/spinlock.h | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/arch/arc/include/asm/spinlock.h b/arch/arc/include/asm/spinlock.h
> index f158197..fddced5 100644
> --- a/arch/arc/include/asm/spinlock.h
> +++ b/arch/arc/include/asm/spinlock.h
> @@ -137,8 +137,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 */
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: [RFC PATCH 02/16] arc: locks: remove unused arch_*_relax operations
2013-06-24 4:12 ` Vineet Gupta
@ 2013-06-24 8:58 ` Will Deacon
0 siblings, 0 replies; 28+ messages in thread
From: Will Deacon @ 2013-06-24 8:58 UTC (permalink / raw)
To: Vineet Gupta; +Cc: linux-arch@vger.kernel.org
On Mon, Jun 24, 2013 at 05:12:25AM +0100, Vineet Gupta wrote:
> Hi Will,
>
> On 06/21/2013 10:47 PM, Will Deacon wrote:
> > The arch_{spin,read,write}_relax macros are not used anywhere in the
> > kernel and are typically just aliases for cpu_relax().
> >
> > This patch removes the unused definitions for Arc.
>
> For consistency sake, can you please uppercase to ARC in changelog above. Same
> goes for arc prefix in patch subject.
Sure, I'll update the log. I honestly had no idea about the casing and I was
too lazy to look it up :)
Cheers,
Will
^ permalink raw reply [flat|nested] 28+ messages in thread
* [RFC PATCH 03/16] ARM: locks: remove unused arch_*_relax operations
2013-06-21 17:17 [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
2013-06-21 17:17 ` [RFC PATCH 01/16] alpha: locks: remove unused arch_*_relax operations Will Deacon
2013-06-21 17:17 ` [RFC PATCH 02/16] arc: " Will Deacon
@ 2013-06-21 17:17 ` Will Deacon
2013-06-21 17:17 ` [RFC PATCH 04/16] arm64: " Will Deacon
` (13 subsequent siblings)
16 siblings, 0 replies; 28+ messages in thread
From: Will Deacon @ 2013-06-21 17:17 UTC (permalink / raw)
To: linux-arch; +Cc: Will Deacon
The arch_{spin,read,write}_relax macros are not used anywhere in the
kernel and are typically just aliases for cpu_relax().
This patch removes the unused definitions for ARM.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/include/asm/spinlock.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h
index 6220e9f..46a55a9 100644
--- a/arch/arm/include/asm/spinlock.h
+++ b/arch/arm/include/asm/spinlock.h
@@ -271,8 +271,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 */
--
1.8.2.2
^ permalink raw reply related [flat|nested] 28+ messages in thread* [RFC PATCH 04/16] arm64: locks: remove unused arch_*_relax operations
2013-06-21 17:17 [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
` (2 preceding siblings ...)
2013-06-21 17:17 ` [RFC PATCH 03/16] ARM: " Will Deacon
@ 2013-06-21 17:17 ` Will Deacon
2013-06-21 17:17 ` [RFC PATCH 05/16] blackfin: " Will Deacon
` (12 subsequent siblings)
16 siblings, 0 replies; 28+ messages in thread
From: Will Deacon @ 2013-06-21 17:17 UTC (permalink / raw)
To: linux-arch; +Cc: Will Deacon, Catalin Marinas
The arch_{spin,read,write}_relax macros are not used anywhere in the
kernel and are typically just aliases for cpu_relax().
This patch removes the unused definitions for arm64.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm64/include/asm/spinlock.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/arm64/include/asm/spinlock.h b/arch/arm64/include/asm/spinlock.h
index 7065e92..efeadbd 100644
--- a/arch/arm64/include/asm/spinlock.h
+++ b/arch/arm64/include/asm/spinlock.h
@@ -195,8 +195,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 */
--
1.8.2.2
^ permalink raw reply related [flat|nested] 28+ messages in thread* [RFC PATCH 05/16] blackfin: locks: remove unused arch_*_relax operations
2013-06-21 17:17 [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
` (3 preceding siblings ...)
2013-06-21 17:17 ` [RFC PATCH 04/16] arm64: " Will Deacon
@ 2013-06-21 17:17 ` Will Deacon
2013-06-21 17:17 ` [RFC PATCH 06/16] cris: " Will Deacon
` (11 subsequent siblings)
16 siblings, 0 replies; 28+ messages in thread
From: Will Deacon @ 2013-06-21 17:17 UTC (permalink / raw)
To: linux-arch; +Cc: Will Deacon, Mike Frysinger
The arch_{spin,read,write}_relax macros are not used anywhere in the
kernel and are typically just aliases for cpu_relax().
This patch removes the unused definitions for Blackfin.
Cc: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/blackfin/include/asm/spinlock.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/blackfin/include/asm/spinlock.h b/arch/blackfin/include/asm/spinlock.h
index 490c7ca..8c58dda 100644
--- a/arch/blackfin/include/asm/spinlock.h
+++ b/arch/blackfin/include/asm/spinlock.h
@@ -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 */
--
1.8.2.2
^ permalink raw reply related [flat|nested] 28+ messages in thread* [RFC PATCH 06/16] cris: locks: remove unused arch_*_relax operations
2013-06-21 17:17 [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
` (4 preceding siblings ...)
2013-06-21 17:17 ` [RFC PATCH 05/16] blackfin: " Will Deacon
@ 2013-06-21 17:17 ` Will Deacon
2013-06-24 6:41 ` Jesper Nilsson
2013-06-21 17:17 ` [RFC PATCH 07/16] ia64: " Will Deacon
` (10 subsequent siblings)
16 siblings, 1 reply; 28+ messages in thread
From: Will Deacon @ 2013-06-21 17:17 UTC (permalink / raw)
To: linux-arch; +Cc: Will Deacon, Mikael Starvik, Jesper Nilsson
The arch_{spin,read,write}_relax macros are not used anywhere in the
kernel and are typically just aliases for cpu_relax().
This patch removes the unused definitions for Cris.
Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/cris/include/arch-v32/arch/spinlock.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/cris/include/arch-v32/arch/spinlock.h b/arch/cris/include/arch-v32/arch/spinlock.h
index f132755..bf94cc6 100644
--- a/arch/cris/include/arch-v32/arch/spinlock.h
+++ b/arch/cris/include/arch-v32/arch/spinlock.h
@@ -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 */
--
1.8.2.2
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [RFC PATCH 06/16] cris: locks: remove unused arch_*_relax operations
2013-06-21 17:17 ` [RFC PATCH 06/16] cris: " Will Deacon
@ 2013-06-24 6:41 ` Jesper Nilsson
0 siblings, 0 replies; 28+ messages in thread
From: Jesper Nilsson @ 2013-06-24 6:41 UTC (permalink / raw)
To: Will Deacon; +Cc: linux-arch@vger.kernel.org, Mikael Starvik, Jesper Nilsson
On Fri, Jun 21, 2013 at 07:17:27PM +0200, Will Deacon wrote:
> The arch_{spin,read,write}_relax macros are not used anywhere in the
> kernel and are typically just aliases for cpu_relax().
>
> This patch removes the unused definitions for Cris.
>
> Cc: Mikael Starvik <starvik@axis.com>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
> ---
> arch/cris/include/arch-v32/arch/spinlock.h | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/arch/cris/include/arch-v32/arch/spinlock.h b/arch/cris/include/arch-v32/arch/spinlock.h
> index f132755..bf94cc6 100644
> --- a/arch/cris/include/arch-v32/arch/spinlock.h
> +++ b/arch/cris/include/arch-v32/arch/spinlock.h
> @@ -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 */
> --
> 1.8.2.2
/^JN - Jesper Nilsson
--
Jesper Nilsson -- jesper.nilsson@axis.com
^ permalink raw reply [flat|nested] 28+ messages in thread
* [RFC PATCH 07/16] ia64: locks: remove unused arch_*_relax operations
2013-06-21 17:17 [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
` (5 preceding siblings ...)
2013-06-21 17:17 ` [RFC PATCH 06/16] cris: " Will Deacon
@ 2013-06-21 17:17 ` Will Deacon
2013-06-21 17:17 ` [RFC PATCH 08/16] m32r: " Will Deacon
` (9 subsequent siblings)
16 siblings, 0 replies; 28+ messages in thread
From: Will Deacon @ 2013-06-21 17:17 UTC (permalink / raw)
To: linux-arch; +Cc: Will Deacon, Tony Luck
The arch_{spin,read,write}_relax macros are not used anywhere in the
kernel and are typically just aliases for cpu_relax().
This patch removes the unused definitions for Itanium.
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/ia64/include/asm/spinlock.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/ia64/include/asm/spinlock.h b/arch/ia64/include/asm/spinlock.h
index 54ff557..041f2bc 100644
--- a/arch/ia64/include/asm/spinlock.h
+++ b/arch/ia64/include/asm/spinlock.h
@@ -284,8 +284,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 */
--
1.8.2.2
^ permalink raw reply related [flat|nested] 28+ messages in thread* [RFC PATCH 08/16] m32r: locks: remove unused arch_*_relax operations
2013-06-21 17:17 [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
` (6 preceding siblings ...)
2013-06-21 17:17 ` [RFC PATCH 07/16] ia64: " Will Deacon
@ 2013-06-21 17:17 ` Will Deacon
2013-06-21 17:17 ` [RFC PATCH 09/16] metag: " Will Deacon
` (8 subsequent siblings)
16 siblings, 0 replies; 28+ messages in thread
From: Will Deacon @ 2013-06-21 17:17 UTC (permalink / raw)
To: linux-arch; +Cc: Will Deacon, Hirokazu Takata
The arch_{spin,read,write}_relax macros are not used anywhere in the
kernel and are typically just aliases for cpu_relax().
This patch removes the unused definitions for m32r.
Cc: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/m32r/include/asm/spinlock.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/m32r/include/asm/spinlock.h b/arch/m32r/include/asm/spinlock.h
index fa13694..3112249 100644
--- a/arch/m32r/include/asm/spinlock.h
+++ b/arch/m32r/include/asm/spinlock.h
@@ -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 */
--
1.8.2.2
^ permalink raw reply related [flat|nested] 28+ messages in thread* [RFC PATCH 09/16] metag: locks: remove unused arch_*_relax operations
2013-06-21 17:17 [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
` (7 preceding siblings ...)
2013-06-21 17:17 ` [RFC PATCH 08/16] m32r: " Will Deacon
@ 2013-06-21 17:17 ` Will Deacon
2013-06-24 9:07 ` James Hogan
2013-06-21 17:17 ` [RFC PATCH 10/16] mips: " Will Deacon
` (7 subsequent siblings)
16 siblings, 1 reply; 28+ messages in thread
From: Will Deacon @ 2013-06-21 17:17 UTC (permalink / raw)
To: linux-arch; +Cc: Will Deacon, James Hogan
The arch_{spin,read,write}_relax macros are not used anywhere in the
kernel and are typically just aliases for cpu_relax().
This patch removes the unused definitions for Metag, including duplicate
definitions of arch_{read,write}_lock_flags.
Cc: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/metag/include/asm/spinlock.h | 4 ----
arch/metag/include/asm/spinlock_lnkget.h | 7 -------
2 files changed, 11 deletions(-)
diff --git a/arch/metag/include/asm/spinlock.h b/arch/metag/include/asm/spinlock.h
index 86a7cf3..15cf4ff 100644
--- a/arch/metag/include/asm/spinlock.h
+++ b/arch/metag/include/asm/spinlock.h
@@ -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 */
diff --git a/arch/metag/include/asm/spinlock_lnkget.h b/arch/metag/include/asm/spinlock_lnkget.h
index ad8436f..73d0345 100644
--- a/arch/metag/include/asm/spinlock_lnkget.h
+++ b/arch/metag/include/asm/spinlock_lnkget.h
@@ -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 */
--
1.8.2.2
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [RFC PATCH 09/16] metag: locks: remove unused arch_*_relax operations
2013-06-21 17:17 ` [RFC PATCH 09/16] metag: " Will Deacon
@ 2013-06-24 9:07 ` James Hogan
0 siblings, 0 replies; 28+ messages in thread
From: James Hogan @ 2013-06-24 9:07 UTC (permalink / raw)
To: Will Deacon; +Cc: linux-arch
On 21/06/13 18:17, Will Deacon wrote:
> The arch_{spin,read,write}_relax macros are not used anywhere in the
> kernel and are typically just aliases for cpu_relax().
>
> This patch removes the unused definitions for Metag, including duplicate
> definitions of arch_{read,write}_lock_flags.
>
> Cc: James Hogan <james.hogan@imgtec.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
Acked-by: James Hogan <james.hogan@imgtec.com>
Thanks
James
^ permalink raw reply [flat|nested] 28+ messages in thread
* [RFC PATCH 10/16] mips: locks: remove unused arch_*_relax operations
2013-06-21 17:17 [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
` (8 preceding siblings ...)
2013-06-21 17:17 ` [RFC PATCH 09/16] metag: " Will Deacon
@ 2013-06-21 17:17 ` Will Deacon
2013-06-21 17:48 ` David Daney
2013-06-21 17:17 ` [RFC PATCH 11/16] hppa: " Will Deacon
` (6 subsequent siblings)
16 siblings, 1 reply; 28+ messages in thread
From: Will Deacon @ 2013-06-21 17:17 UTC (permalink / raw)
To: linux-arch; +Cc: Will Deacon, Ralf Baechle, David Daney
The arch_{spin,read,write}_relax macros are not used anywhere in the
kernel and are typically just aliases for cpu_relax().
This patch removes the unused definitions for MIPS.
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: David Daney <david.daney@cavium.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/mips/include/asm/spinlock.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/mips/include/asm/spinlock.h b/arch/mips/include/asm/spinlock.h
index 78d201f..7bd850a 100644
--- a/arch/mips/include/asm/spinlock.h
+++ b/arch/mips/include/asm/spinlock.h
@@ -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 */
--
1.8.2.2
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [RFC PATCH 10/16] mips: locks: remove unused arch_*_relax operations
2013-06-21 17:17 ` [RFC PATCH 10/16] mips: " Will Deacon
@ 2013-06-21 17:48 ` David Daney
0 siblings, 0 replies; 28+ messages in thread
From: David Daney @ 2013-06-21 17:48 UTC (permalink / raw)
To: Will Deacon; +Cc: linux-arch, Ralf Baechle, David Daney
On 06/21/2013 10:17 AM, Will Deacon wrote:
> The arch_{spin,read,write}_relax macros are not used anywhere in the
> kernel and are typically just aliases for cpu_relax().
>
> This patch removes the unused definitions for MIPS.
>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: David Daney <david.daney@cavium.com>
FWIW: Acked-by: David Daney <david.daney@cavium.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
> ---
> arch/mips/include/asm/spinlock.h | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/arch/mips/include/asm/spinlock.h b/arch/mips/include/asm/spinlock.h
> index 78d201f..7bd850a 100644
> --- a/arch/mips/include/asm/spinlock.h
> +++ b/arch/mips/include/asm/spinlock.h
> @@ -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 */
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* [RFC PATCH 11/16] hppa: locks: remove unused arch_*_relax operations
2013-06-21 17:17 [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
` (9 preceding siblings ...)
2013-06-21 17:17 ` [RFC PATCH 10/16] mips: " Will Deacon
@ 2013-06-21 17:17 ` Will Deacon
2013-06-21 17:17 ` [RFC PATCH 12/16] powerpc: " Will Deacon
` (5 subsequent siblings)
16 siblings, 0 replies; 28+ messages in thread
From: Will Deacon @ 2013-06-21 17:17 UTC (permalink / raw)
To: linux-arch; +Cc: Will Deacon, Helge Deller
The arch_{spin,read,write}_relax macros are not used anywhere in the
kernel and are typically just aliases for cpu_relax().
This patch removes the unused definitions for parisc.
Cc: Helge Deller <deller@gmx.de>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/parisc/include/asm/spinlock.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/parisc/include/asm/spinlock.h b/arch/parisc/include/asm/spinlock.h
index 3516e0b..64f2992 100644
--- a/arch/parisc/include/asm/spinlock.h
+++ b/arch/parisc/include/asm/spinlock.h
@@ -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 */
--
1.8.2.2
^ permalink raw reply related [flat|nested] 28+ messages in thread* [RFC PATCH 12/16] powerpc: locks: remove unused arch_*_relax operations
2013-06-21 17:17 [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
` (10 preceding siblings ...)
2013-06-21 17:17 ` [RFC PATCH 11/16] hppa: " Will Deacon
@ 2013-06-21 17:17 ` Will Deacon
2013-06-21 22:16 ` Benjamin Herrenschmidt
2013-06-21 17:17 ` [RFC PATCH 13/16] s390: " Will Deacon
` (4 subsequent siblings)
16 siblings, 1 reply; 28+ messages in thread
From: Will Deacon @ 2013-06-21 17:17 UTC (permalink / raw)
To: linux-arch; +Cc: Will Deacon, Benjamin Herrenschmidt
The arch_{spin,read,write}_relax macros are not used anywhere in the
kernel and are typically just aliases for cpu_relax().
This patch removes the unused definitions for PowerPC.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/powerpc/include/asm/spinlock.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h
index 5b23f91..2d4a841 100644
--- a/arch/powerpc/include/asm/spinlock.h
+++ b/arch/powerpc/include/asm/spinlock.h
@@ -291,9 +291,5 @@ 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) __spin_yield(lock)
-#define arch_read_relax(lock) __rw_yield(lock)
-#define arch_write_relax(lock) __rw_yield(lock)
-
#endif /* __KERNEL__ */
#endif /* __ASM_SPINLOCK_H */
--
1.8.2.2
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [RFC PATCH 12/16] powerpc: locks: remove unused arch_*_relax operations
2013-06-21 17:17 ` [RFC PATCH 12/16] powerpc: " Will Deacon
@ 2013-06-21 22:16 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 28+ messages in thread
From: Benjamin Herrenschmidt @ 2013-06-21 22:16 UTC (permalink / raw)
To: Will Deacon; +Cc: linux-arch
On Fri, 2013-06-21 at 18:17 +0100, Will Deacon wrote:
> The arch_{spin,read,write}_relax macros are not used anywhere in the
> kernel and are typically just aliases for cpu_relax().
>
> This patch removes the unused definitions for PowerPC.
>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
> ---
> arch/powerpc/include/asm/spinlock.h | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h
> index 5b23f91..2d4a841 100644
> --- a/arch/powerpc/include/asm/spinlock.h
> +++ b/arch/powerpc/include/asm/spinlock.h
> @@ -291,9 +291,5 @@ 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) __spin_yield(lock)
> -#define arch_read_relax(lock) __rw_yield(lock)
> -#define arch_write_relax(lock) __rw_yield(lock)
> -
> #endif /* __KERNEL__ */
> #endif /* __ASM_SPINLOCK_H */
^ permalink raw reply [flat|nested] 28+ messages in thread
* [RFC PATCH 13/16] s390: locks: remove unused arch_*_relax operations
2013-06-21 17:17 [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
` (11 preceding siblings ...)
2013-06-21 17:17 ` [RFC PATCH 12/16] powerpc: " Will Deacon
@ 2013-06-21 17:17 ` Will Deacon
2013-06-21 17:17 ` [RFC PATCH 14/16] sh: " Will Deacon
` (3 subsequent siblings)
16 siblings, 0 replies; 28+ messages in thread
From: Will Deacon @ 2013-06-21 17:17 UTC (permalink / raw)
To: linux-arch; +Cc: Will Deacon, Martin Schwidefsky
The arch_{read,write}_relax macros are not used anywhere in the
kernel and are typically just aliases for cpu_relax().
This patch removes the unused definitions for S390. arch_spin_relax is
left alone, since the S390 spinlock internals rely on (and export) this
symbol.
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/s390/include/asm/spinlock.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
index 701fe8c..8b030e2 100644
--- a/arch/s390/include/asm/spinlock.h
+++ b/arch/s390/include/asm/spinlock.h
@@ -170,7 +170,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 */
--
1.8.2.2
^ permalink raw reply related [flat|nested] 28+ messages in thread* [RFC PATCH 14/16] sh: locks: remove unused arch_*_relax operations
2013-06-21 17:17 [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
` (12 preceding siblings ...)
2013-06-21 17:17 ` [RFC PATCH 13/16] s390: " Will Deacon
@ 2013-06-21 17:17 ` Will Deacon
2013-06-21 17:17 ` [RFC PATCH 15/16] sparc: " Will Deacon
` (2 subsequent siblings)
16 siblings, 0 replies; 28+ messages in thread
From: Will Deacon @ 2013-06-21 17:17 UTC (permalink / raw)
To: linux-arch; +Cc: Will Deacon, Paul Mundt
The arch_{spin,read,write}_relax macros are not used anywhere in the
kernel and are typically just aliases for cpu_relax().
This patch removes the unused definitions for SuperH.
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/sh/include/asm/spinlock.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/sh/include/asm/spinlock.h b/arch/sh/include/asm/spinlock.h
index bdc0f3b..a89820d 100644
--- a/arch/sh/include/asm/spinlock.h
+++ b/arch/sh/include/asm/spinlock.h
@@ -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 */
--
1.8.2.2
^ permalink raw reply related [flat|nested] 28+ messages in thread* [RFC PATCH 15/16] sparc: locks: remove unused arch_*_relax operations
2013-06-21 17:17 [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
` (13 preceding siblings ...)
2013-06-21 17:17 ` [RFC PATCH 14/16] sh: " Will Deacon
@ 2013-06-21 17:17 ` Will Deacon
2013-06-21 19:18 ` David Miller
2013-06-21 17:17 ` [RFC PATCH 16/16] x86: " Will Deacon
2013-06-24 11:58 ` [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
16 siblings, 1 reply; 28+ messages in thread
From: Will Deacon @ 2013-06-21 17:17 UTC (permalink / raw)
To: linux-arch; +Cc: Will Deacon, David Miller
The arch_{spin,read,write}_relax macros are not used anywhere in the
kernel and are typically just aliases for cpu_relax().
This patch removes the unused definitions for Sparc.
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/sparc/include/asm/spinlock_32.h | 4 ----
arch/sparc/include/asm/spinlock_64.h | 4 ----
2 files changed, 8 deletions(-)
diff --git a/arch/sparc/include/asm/spinlock_32.h b/arch/sparc/include/asm/spinlock_32.h
index bcc98fc..180c8f3 100644
--- a/arch/sparc/include/asm/spinlock_32.h
+++ b/arch/sparc/include/asm/spinlock_32.h
@@ -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)
diff --git a/arch/sparc/include/asm/spinlock_64.h b/arch/sparc/include/asm/spinlock_64.h
index 9689176..f3b7a88 100644
--- a/arch/sparc/include/asm/spinlock_64.h
+++ b/arch/sparc/include/asm/spinlock_64.h
@@ -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) */
--
1.8.2.2
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [RFC PATCH 15/16] sparc: locks: remove unused arch_*_relax operations
2013-06-21 17:17 ` [RFC PATCH 15/16] sparc: " Will Deacon
@ 2013-06-21 19:18 ` David Miller
0 siblings, 0 replies; 28+ messages in thread
From: David Miller @ 2013-06-21 19:18 UTC (permalink / raw)
To: will.deacon; +Cc: linux-arch
From: Will Deacon <will.deacon@arm.com>
Date: Fri, 21 Jun 2013 18:17:36 +0100
> The arch_{spin,read,write}_relax macros are not used anywhere in the
> kernel and are typically just aliases for cpu_relax().
>
> This patch removes the unused definitions for Sparc.
>
> Cc: David Miller <davem@davemloft.net>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply [flat|nested] 28+ messages in thread
* [RFC PATCH 16/16] x86: locks: remove unused arch_*_relax operations
2013-06-21 17:17 [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
` (14 preceding siblings ...)
2013-06-21 17:17 ` [RFC PATCH 15/16] sparc: " Will Deacon
@ 2013-06-21 17:17 ` Will Deacon
2013-06-21 20:48 ` Thomas Gleixner
2013-06-24 11:58 ` [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
16 siblings, 1 reply; 28+ messages in thread
From: Will Deacon @ 2013-06-21 17:17 UTC (permalink / raw)
To: linux-arch; +Cc: Will Deacon, Thomas Gleixner, Ingo Molnar, H. Peter Anvin
The arch_{spin,read,write}_relax macros are not used anywhere in the
kernel and are typically just aliases for cpu_relax().
This patch removes the unused definitions for x86.
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/x86/include/asm/spinlock.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
index 33692ea..1088d8d 100644
--- a/arch/x86/include/asm/spinlock.h
+++ b/arch/x86/include/asm/spinlock.h
@@ -229,10 +229,6 @@ 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()
-
/* The {read|write|spin}_lock() on x86 are full memory barriers. */
static inline void smp_mb__after_lock(void) { }
#define ARCH_HAS_SMP_MB_AFTER_LOCK
--
1.8.2.2
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [RFC PATCH 16/16] x86: locks: remove unused arch_*_relax operations
2013-06-21 17:17 ` [RFC PATCH 16/16] x86: " Will Deacon
@ 2013-06-21 20:48 ` Thomas Gleixner
0 siblings, 0 replies; 28+ messages in thread
From: Thomas Gleixner @ 2013-06-21 20:48 UTC (permalink / raw)
To: Will Deacon; +Cc: linux-arch, Ingo Molnar, H. Peter Anvin
On Fri, 21 Jun 2013, Will Deacon wrote:
> The arch_{spin,read,write}_relax macros are not used anywhere in the
> kernel and are typically just aliases for cpu_relax().
>
> This patch removes the unused definitions for x86.
>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: H. Peter Anvin <hpa@zytor.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
> ---
> arch/x86/include/asm/spinlock.h | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
> index 33692ea..1088d8d 100644
> --- a/arch/x86/include/asm/spinlock.h
> +++ b/arch/x86/include/asm/spinlock.h
> @@ -229,10 +229,6 @@ 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()
> -
> /* The {read|write|spin}_lock() on x86 are full memory barriers. */
> static inline void smp_mb__after_lock(void) { }
> #define ARCH_HAS_SMP_MB_AFTER_LOCK
> --
> 1.8.2.2
>
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks
2013-06-21 17:17 [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
` (15 preceding siblings ...)
2013-06-21 17:17 ` [RFC PATCH 16/16] x86: " Will Deacon
@ 2013-06-24 11:58 ` Will Deacon
2013-06-28 7:31 ` Martin Schwidefsky
16 siblings, 1 reply; 28+ messages in thread
From: Will Deacon @ 2013-06-24 11:58 UTC (permalink / raw)
To: linux-arch@vger.kernel.org
Cc: catalin.marinas, benh, tony.luck, takata, schwidefsky, lethal,
tglx, davem, deller
On Fri, Jun 21, 2013 at 06:17:21PM +0100, Will Deacon wrote:
> This is an RFC cleanup series removing the unused
> arch_{spin,read,write}_relax macros from (nearly) all architectures that
> define them. The macros have no users in core code and are typically
> synonymous with cpu_relax(), the notable exceptions being PowerPC (where
> the thing is still unused) and S390.
So the `no users in core code' part isn't quite true...
With GENERIC_LOCKBREAK (arm64, ia64, m32r, parisc, powerpc, s390, sh and
sparc), we can actually spit out arch_*_relax calls in kernel/spinlock.c
using some macro concatenation that defeated my grep-fu.
This only makes a difference on powerpc and s390, so we could either:
(1) conditionally define the relax macros as cpu_relax in spinlock.c (so
the two guys above can have their special versions)
(2) Replace the calls with calls to cpu_relax() (although powerpc seems to
want to know who owns the lock in order to relax)
(3) Leave the current code alone for architectures that may select
GENERIC_LOCKBREAK
Any other ideas/preferences?
Will
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks
2013-06-24 11:58 ` [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks Will Deacon
@ 2013-06-28 7:31 ` Martin Schwidefsky
2013-07-01 8:53 ` Will Deacon
0 siblings, 1 reply; 28+ messages in thread
From: Martin Schwidefsky @ 2013-06-28 7:31 UTC (permalink / raw)
To: Will Deacon
Cc: linux-arch@vger.kernel.org, catalin.marinas, benh, tony.luck,
takata, lethal, tglx, davem, deller
On Mon, 24 Jun 2013 12:58:25 +0100
Will Deacon <will.deacon@arm.com> wrote:
> On Fri, Jun 21, 2013 at 06:17:21PM +0100, Will Deacon wrote:
> > This is an RFC cleanup series removing the unused
> > arch_{spin,read,write}_relax macros from (nearly) all architectures that
> > define them. The macros have no users in core code and are typically
> > synonymous with cpu_relax(), the notable exceptions being PowerPC (where
> > the thing is still unused) and S390.
>
> So the `no users in core code' part isn't quite true...
>
> With GENERIC_LOCKBREAK (arm64, ia64, m32r, parisc, powerpc, s390, sh and
> sparc), we can actually spit out arch_*_relax calls in kernel/spinlock.c
> using some macro concatenation that defeated my grep-fu.
>
> This only makes a difference on powerpc and s390, so we could either:
>
> (1) conditionally define the relax macros as cpu_relax in spinlock.c (so
> the two guys above can have their special versions)
>
> (2) Replace the calls with calls to cpu_relax() (although powerpc seems to
> want to know who owns the lock in order to relax)
>
> (3) Leave the current code alone for architectures that may select
> GENERIC_LOCKBREAK
>
> Any other ideas/preferences?
Yeah, we never came around to implement arch_read/write_relax. We can remove
the two defines for s390, if we want to add some logic there we can just re-add
an appropriate definition. As powerpc is optimizing their read/write locks
with GENERIC_LOCKBREAK=y we should leave the ability to override the relax
function as it is, no?
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: [RFC PATCH 00/16] Remove unused arch_*_relax operations from spinlocks
2013-06-28 7:31 ` Martin Schwidefsky
@ 2013-07-01 8:53 ` Will Deacon
0 siblings, 0 replies; 28+ messages in thread
From: Will Deacon @ 2013-07-01 8:53 UTC (permalink / raw)
To: Martin Schwidefsky
Cc: linux-arch@vger.kernel.org, Catalin Marinas,
benh@kernel.crashing.org, tony.luck@intel.com,
takata@linux-m32r.org, lethal@linux-sh.org, tglx@linutronix.de,
davem@davemloft.net, deller@gmx.de
On Fri, Jun 28, 2013 at 08:31:03AM +0100, Martin Schwidefsky wrote:
> On Mon, 24 Jun 2013 12:58:25 +0100
> Will Deacon <will.deacon@arm.com> wrote:
> > With GENERIC_LOCKBREAK (arm64, ia64, m32r, parisc, powerpc, s390, sh and
> > sparc), we can actually spit out arch_*_relax calls in kernel/spinlock.c
> > using some macro concatenation that defeated my grep-fu.
> >
> > This only makes a difference on powerpc and s390, so we could either:
> >
> > (1) conditionally define the relax macros as cpu_relax in spinlock.c (so
> > the two guys above can have their special versions)
> >
> > (2) Replace the calls with calls to cpu_relax() (although powerpc seems to
> > want to know who owns the lock in order to relax)
> >
> > (3) Leave the current code alone for architectures that may select
> > GENERIC_LOCKBREAK
> >
> > Any other ideas/preferences?
>
> Yeah, we never came around to implement arch_read/write_relax. We can remove
> the two defines for s390, if we want to add some logic there we can just re-add
> an appropriate definition. As powerpc is optimizing their read/write locks
> with GENERIC_LOCKBREAK=y we should leave the ability to override the relax
> function as it is, no?
Yes, I'll drop the powerpc patch and then add the following patch to the
start of the series for v2.
Cheers,
Will
--->8
From 87707347c9239b647c3b1dd57063eac08fdb1bf4 Mon Sep 17 00:00:00 2001
From: Will Deacon <will.deacon@arm.com>
Date: Mon, 24 Jun 2013 19:06:51 +0100
Subject: [PATCH] locking: add default arch_*_relax definitions for
GENERIC_LOCKBREAK
When running with GENERIC_LOCKBREAK=y, the locking implementations emit
calls to arch_{read,write,spin}_relax when spinning on a contended lock
in order to allow architectures to favour the CPU owning the lock if
possible.
In reality, everybody apart from PowerPC and S390 just does cpu_relax()
here, so make that the default behaviour and allow it to be overridden
if required.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
kernel/spinlock.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/kernel/spinlock.c b/kernel/spinlock.c
index 5cdd806..4b082b5 100644
--- a/kernel/spinlock.c
+++ b/kernel/spinlock.c
@@ -34,6 +34,20 @@
#else
#define raw_read_can_lock(l) read_can_lock(l)
#define raw_write_can_lock(l) write_can_lock(l)
+
+/*
+ * Some architectures can relax in favour of the CPU owning the lock.
+ */
+#ifndef arch_read_relax
+# define arch_read_relax(l) cpu_relax()
+#endif
+#ifndef arch_write_relax
+# define arch_write_relax(l) cpu_relax()
+#endif
+#ifndef arch_spin_relax
+# define arch_spin_relax(l) cpu_relax()
+#endif
+
/*
* We build the __lock_function inlines here. They are too large for
* inlining all over the place, but here is only one user per function
--
1.8.2.2
^ permalink raw reply related [flat|nested] 28+ messages in thread