* [RFC PATCH] ARM: cmpxchg: define __HAVE_ARCH_CMPXCHG for armv6 and later
@ 2012-05-30 7:51 Yong Zhang
2012-05-31 1:24 ` Will Deacon
0 siblings, 1 reply; 3+ messages in thread
From: Yong Zhang @ 2012-05-30 7:51 UTC (permalink / raw)
To: linux-arm-kernel
From: Yong Zhang <yong.zhang@windriver.com>
Both pi_stress and sigwaittest in rt-test show performance gain with
__HAVE_ARCH_CMPXCHG. Testing result on coretile_express_a9x4:
pi_stress -p 99 --duration=300 (on linux-3.4-rc5; bigger is better)
vanilla: Total inversion performed: 5493381
patched: Total inversion performed: 5621746
sigwaittest -p 99 -l 100000 (on linux-3.4-rc5-rt6; less is better)
3.4-rc5-rt6: Min 24, Cur 27, Avg 30, Max 98
patched: Min 19, Cur 21, Avg 23, Max 96
Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Nicolas Pitre <nico@linaro.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-arm-kernel at lists.infradead.org
---
arch/arm/include/asm/cmpxchg.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/cmpxchg.h b/arch/arm/include/asm/cmpxchg.h
index 7eb18c1..a91b44e 100644
--- a/arch/arm/include/asm/cmpxchg.h
+++ b/arch/arm/include/asm/cmpxchg.h
@@ -127,6 +127,8 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size
#else /* min ARCH >= ARMv6 */
+#define __HAVE_ARCH_CMPXCHG 1
+
extern void __bad_cmpxchg(volatile void *ptr, int size);
/*
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [RFC PATCH] ARM: cmpxchg: define __HAVE_ARCH_CMPXCHG for armv6 and later
2012-05-30 7:51 [RFC PATCH] ARM: cmpxchg: define __HAVE_ARCH_CMPXCHG for armv6 and later Yong Zhang
@ 2012-05-31 1:24 ` Will Deacon
2012-05-31 12:50 ` Yong Zhang
0 siblings, 1 reply; 3+ messages in thread
From: Will Deacon @ 2012-05-31 1:24 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
On Wed, May 30, 2012 at 08:51:26AM +0100, Yong Zhang wrote:
> diff --git a/arch/arm/include/asm/cmpxchg.h b/arch/arm/include/asm/cmpxchg.h
> index 7eb18c1..a91b44e 100644
> --- a/arch/arm/include/asm/cmpxchg.h
> +++ b/arch/arm/include/asm/cmpxchg.h
> @@ -127,6 +127,8 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size
>
> #else /* min ARCH >= ARMv6 */
>
> +#define __HAVE_ARCH_CMPXCHG 1
> +
> extern void __bad_cmpxchg(volatile void *ptr, int size);
As long as this only requires 4-byte cmpxchg support then I think this is
fine. It looks like that's currently the case, so:
Acked-by: Will Deacon <will.deacon@arm.com>
Will
^ permalink raw reply [flat|nested] 3+ messages in thread
* [RFC PATCH] ARM: cmpxchg: define __HAVE_ARCH_CMPXCHG for armv6 and later
2012-05-31 1:24 ` Will Deacon
@ 2012-05-31 12:50 ` Yong Zhang
0 siblings, 0 replies; 3+ messages in thread
From: Yong Zhang @ 2012-05-31 12:50 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, May 31, 2012 at 02:24:50AM +0100, Will Deacon wrote:
> Hello,
>
> On Wed, May 30, 2012 at 08:51:26AM +0100, Yong Zhang wrote:
> > diff --git a/arch/arm/include/asm/cmpxchg.h b/arch/arm/include/asm/cmpxchg.h
> > index 7eb18c1..a91b44e 100644
> > --- a/arch/arm/include/asm/cmpxchg.h
> > +++ b/arch/arm/include/asm/cmpxchg.h
> > @@ -127,6 +127,8 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size
> >
> > #else /* min ARCH >= ARMv6 */
> >
> > +#define __HAVE_ARCH_CMPXCHG 1
> > +
> > extern void __bad_cmpxchg(volatile void *ptr, int size);
>
> As long as this only requires 4-byte cmpxchg support then I think this is
> fine. It looks like that's currently the case, so:
Yes and thanks for review.
Yong
>
> Acked-by: Will Deacon <will.deacon@arm.com>
>
> Will
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-05-31 12:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-30 7:51 [RFC PATCH] ARM: cmpxchg: define __HAVE_ARCH_CMPXCHG for armv6 and later Yong Zhang
2012-05-31 1:24 ` Will Deacon
2012-05-31 12:50 ` Yong Zhang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).