* [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown
@ 2010-06-17 4:47 Paul E. McKenney
2010-06-17 4:47 ` [ltt-dev] [PATCH tip/core/rcu 1/4] Add header files supporting gcc __sync_ primitives Paul E. McKenney
` (4 more replies)
0 siblings, 5 replies; 11+ messages in thread
From: Paul E. McKenney @ 2010-06-17 4:47 UTC (permalink / raw)
Hello!
This set of four patches does the following:
o Add header files providing definitions based on the gcc __sync_
set of primitives.
o Add IA64 support based on the gcc definitions.
o Add native ARMv7L support.
o Force build failures on unknown architectures.
Updates since v1:
o Add note that this works back to at least 2.6.15 kernels.
Thanx, Paul
b/configure.ac | 1
b/urcu/arch_armv7l.h | 59 ++++++++++++++++++++++++++++++++++++++++++
b/urcu/arch_gcc.h | 59 ++++++++++++++++++++++++++++++++++++++++++
b/urcu/arch_unknown.h | 28 +++++++++++++++++++
b/urcu/uatomic_arch_armv7l.h | 50 +++++++++++++++++++++++++++++++++++
b/urcu/uatomic_arch_gcc.h | 48 ++++++++++++++++++++++++++++++++++
b/urcu/uatomic_arch_unknown.h | 25 +++++++++++++++++
configure.ac | 13 ++++-----
8 files changed, 276 insertions(+), 7 deletions(-)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ltt-dev] [PATCH tip/core/rcu 1/4] Add header files supporting gcc __sync_ primitives
2010-06-17 4:47 [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown Paul E. McKenney
@ 2010-06-17 4:47 ` Paul E. McKenney
2010-06-17 7:55 ` Paolo Bonzini
2010-06-17 4:47 ` [ltt-dev] [PATCH tip/core/rcu 2/4] Add ia64 architecture based on gcc primitives Paul E. McKenney
` (3 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Paul E. McKenney @ 2010-06-17 4:47 UTC (permalink / raw)
Add a urcu/arch_gcc.h and urcu/uatomic_arch_gcc.h whose primitives are
based on the gcc __sync_ primitives. This should be usable for all
systems that have correctly implemented __sync_ primitives, which sadly
does not include all combinations of systems and compilers. In addition,
specific systems may gain higher performance with hand-coded primitives.
Nevertheless, this is nice for getting a new architecture up and running
quickly.
Signed-off-by: Paul E. McKenney <paulmck at linux.vnet.ibm.com>
---
urcu/arch_gcc.h | 59 +++++++++++++++++++++++++++++++++++++++++++++++
urcu/uatomic_arch_gcc.h | 48 ++++++++++++++++++++++++++++++++++++++
2 files changed, 107 insertions(+), 0 deletions(-)
create mode 100644 urcu/arch_gcc.h
create mode 100644 urcu/uatomic_arch_gcc.h
diff --git a/urcu/arch_gcc.h b/urcu/arch_gcc.h
new file mode 100644
index 0000000..b625ae5
--- /dev/null
+++ b/urcu/arch_gcc.h
@@ -0,0 +1,59 @@
+#ifndef _URCU_ARCH_GCC_H
+#define _URCU_ARCH_GCC_H
+
+/*
+ * arch_unknown.h: trivial definitions for architectures using gcc __sync_
+ *
+ * Copyright (c) 2010 Paul E. McKenney, IBM Corporation.
+ * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers at polymtl.ca>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <urcu/compiler.h>
+#include <urcu/config.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* We don't know, so guess!!! */
+#define CACHE_LINE_SIZE 128
+
+#define mb() __sync_synchronize()
+
+#include <stdlib.h>
+#include <sys/time.h>
+
+typedef unsigned long long cycles_t;
+
+static inline cycles_t get_cycles (void)
+{
+ cycles_t thetime;
+ struct timeval tv;
+
+ if (gettimeofday(&tv, NULL) != 0)
+ return 0;
+ thetime = ((cycles_t)tv.tv_sec) * 1000000ULL + ((cycles_t)tv.tv_usec);
+ return (cycles_t)thetime;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#include <urcu/arch_generic.h>
+
+#endif /* _URCU_ARCH_GCC_H */
diff --git a/urcu/uatomic_arch_gcc.h b/urcu/uatomic_arch_gcc.h
new file mode 100644
index 0000000..df208bd
--- /dev/null
+++ b/urcu/uatomic_arch_gcc.h
@@ -0,0 +1,48 @@
+#ifndef _URCU_ARCH_UATOMIC_GCC_H
+#define _URCU_ARCH_UATOMIC_GCC_H
+
+/*
+ * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
+ * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
+ * Copyright (c) 1999-2004 Hewlett-Packard Development Company, L.P.
+ * Copyright (c) 2009 Mathieu Desnoyers
+ * Copyright (c) 2010 Paul E. McKenney, IBM Corporation
+ * (Adapted from uatomic_arch_ppc.h)
+ *
+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+ * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
+ *
+ * Permission is hereby granted to use or copy this program
+ * for any purpose, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ * Code inspired from libuatomic_ops-1.2, inherited in part from the
+ * Boehm-Demers-Weiser conservative garbage collector.
+ */
+
+#include <urcu/compiler.h>
+#include <urcu/system.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* xchg */
+#define uatomic_xchg(addr, v) __sync_lock_test_and_set(addr, v)
+
+/* cmpxchg */
+#define uatomic_cmpxchg(addr, old, _new) \
+ __sync_val_compare_and_swap(addr, old, _new)
+
+/* uatomic_add_return */
+#define uatomic_add_return(addr, v) __sync_add_and_fetch(addr, v)
+
+#ifdef __cplusplus
+}
+#endif
+
+#include <urcu/uatomic_generic.h>
+
+#endif /* _URCU_ARCH_UATOMIC_GCC_H */
--
1.7.0.6
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ltt-dev] [PATCH tip/core/rcu 2/4] Add ia64 architecture based on gcc primitives
2010-06-17 4:47 [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown Paul E. McKenney
2010-06-17 4:47 ` [ltt-dev] [PATCH tip/core/rcu 1/4] Add header files supporting gcc __sync_ primitives Paul E. McKenney
@ 2010-06-17 4:47 ` Paul E. McKenney
2010-06-17 4:47 ` [ltt-dev] [PATCH tip/core/rcu 3/4] Add native ARM port for armv7l Paul E. McKenney
` (2 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: Paul E. McKenney @ 2010-06-17 4:47 UTC (permalink / raw)
This of course assumes that ia64 gcc correctly implements the various
__sync_ primitives. ;-)
Signed-off-by: Paul E. McKenney <paulmck at linux.vnet.ibm.com>
---
configure.ac | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index 1b1ca65..61a0d76 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,6 +51,7 @@ case $host_cpu in
s390x) ARCHTYPE="s390" ;;
sparc64) ARCHTYPE="sparc64" ;;
alpha*) ARCHTYPE="alpha" ;;
+ ia64) ARCHTYPE="gcc" ;;
*) ARCHTYPE="unknown";;
esac
--
1.7.0.6
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ltt-dev] [PATCH tip/core/rcu 3/4] Add native ARM port for armv7l
2010-06-17 4:47 [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown Paul E. McKenney
2010-06-17 4:47 ` [ltt-dev] [PATCH tip/core/rcu 1/4] Add header files supporting gcc __sync_ primitives Paul E. McKenney
2010-06-17 4:47 ` [ltt-dev] [PATCH tip/core/rcu 2/4] Add ia64 architecture based on gcc primitives Paul E. McKenney
@ 2010-06-17 4:47 ` Paul E. McKenney
2010-06-17 4:48 ` [ltt-dev] [PATCH tip/core/rcu 4/4] Force build failure on unknown architectures Paul E. McKenney
2010-06-18 15:46 ` [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown Mathieu Desnoyers
4 siblings, 0 replies; 11+ messages in thread
From: Paul E. McKenney @ 2010-06-17 4:47 UTC (permalink / raw)
Add native support for armv7l. Other variants of ARM will likely require
separate ports. The gcc __sync_ approach works back to at least 2.6.15
kernels.
Signed-off-by: Paul E. McKenney <paulmck at linux.vnet.ibm.com>
---
configure.ac | 4 +++
urcu/arch_armv7l.h | 59 ++++++++++++++++++++++++++++++++++++++++++++
urcu/uatomic_arch_armv7l.h | 50 +++++++++++++++++++++++++++++++++++++
3 files changed, 113 insertions(+), 0 deletions(-)
create mode 100644 urcu/arch_armv7l.h
create mode 100644 urcu/uatomic_arch_armv7l.h
diff --git a/configure.ac b/configure.ac
index 61a0d76..7b46004 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,6 +52,7 @@ case $host_cpu in
sparc64) ARCHTYPE="sparc64" ;;
alpha*) ARCHTYPE="alpha" ;;
ia64) ARCHTYPE="gcc" ;;
+ armv7l) ARCHTYPE="armv7l" ;;
*) ARCHTYPE="unknown";;
esac
@@ -67,6 +68,9 @@ if test "x$ARCHTYPE" != xx86 -a "x$ARCHTYPE" != xppc; then
else
APISRC=tests/api_$ARCHTYPE.h
fi
+if test "$ARCHTYPE" == "armv7l"; then
+ CFLAGS="-mcpu=cortex-a9 -mtune=cortex-a9 -O"
+fi
AC_SUBST(ARCHTYPE)
AC_SUBST(SUBARCHTYPE)
diff --git a/urcu/arch_armv7l.h b/urcu/arch_armv7l.h
new file mode 100644
index 0000000..cfe05ef
--- /dev/null
+++ b/urcu/arch_armv7l.h
@@ -0,0 +1,59 @@
+#ifndef _URCU_ARCH_ARMV7L_H
+#define _URCU_ARCH_ARMV7L_H
+
+/*
+ * arch_armv7l.h: trivial definitions for the ARMv7 architecture.
+ *
+ * Copyright (c) 2010 Paul E. McKenney, IBM Corporation.
+ * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers at polymtl.ca>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <urcu/compiler.h>
+#include <urcu/config.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* We don't know, so guess!!! */
+#define CACHE_LINE_SIZE 128
+
+#define mb() asm volatile("dmb":::"memory")
+
+#include <stdlib.h>
+#include <sys/time.h>
+
+typedef unsigned long long cycles_t;
+
+static inline cycles_t get_cycles (void)
+{
+ cycles_t thetime;
+ struct timeval tv;
+
+ if (gettimeofday(&tv, NULL) != 0)
+ return 0;
+ thetime = ((cycles_t)tv.tv_sec) * 1000000ULL + ((cycles_t)tv.tv_usec);
+ return (cycles_t)thetime;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#include <urcu/arch_generic.h>
+
+#endif /* _URCU_ARCH_ARMV7L_H */
diff --git a/urcu/uatomic_arch_armv7l.h b/urcu/uatomic_arch_armv7l.h
new file mode 100644
index 0000000..b68c818
--- /dev/null
+++ b/urcu/uatomic_arch_armv7l.h
@@ -0,0 +1,50 @@
+#ifndef _URCU_ARCH_UATOMIC_ARMV7L_H
+#define _URCU_ARCH_UATOMIC_ARMV7L_H
+
+/*
+ * Atomics for ARMv7. This approach is usable on kernels back to 2.6.15.
+ *
+ * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
+ * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
+ * Copyright (c) 1999-2004 Hewlett-Packard Development Company, L.P.
+ * Copyright (c) 2009 Mathieu Desnoyers
+ * Copyright (c) 2010 Paul E. McKenney, IBM Corporation
+ * (Adapted from uatomic_arch_ppc.h)
+ *
+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+ * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
+ *
+ * Permission is hereby granted to use or copy this program
+ * for any purpose, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ * Code inspired from libuatomic_ops-1.2, inherited in part from the
+ * Boehm-Demers-Weiser conservative garbage collector.
+ */
+
+#include <urcu/compiler.h>
+#include <urcu/system.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* xchg */
+#define uatomic_xchg(addr, v) __sync_lock_test_and_set(addr, v)
+
+/* cmpxchg */
+#define uatomic_cmpxchg(addr, old, _new) \
+ __sync_val_compare_and_swap(addr, old, _new)
+
+/* uatomic_add_return */
+#define uatomic_add_return(addr, v) __sync_add_and_fetch(addr, v)
+
+#ifdef __cplusplus
+}
+#endif
+
+#include <urcu/uatomic_generic.h>
+
+#endif /* _URCU_ARCH_UATOMIC_ARMV7L_H */
--
1.7.0.6
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ltt-dev] [PATCH tip/core/rcu 4/4] Force build failure on unknown architectures
2010-06-17 4:47 [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown Paul E. McKenney
` (2 preceding siblings ...)
2010-06-17 4:47 ` [ltt-dev] [PATCH tip/core/rcu 3/4] Add native ARM port for armv7l Paul E. McKenney
@ 2010-06-17 4:48 ` Paul E. McKenney
2010-06-18 15:46 ` [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown Mathieu Desnoyers
4 siblings, 0 replies; 11+ messages in thread
From: Paul E. McKenney @ 2010-06-17 4:48 UTC (permalink / raw)
Create urcu/arch_unknown.h and urcu/uatomic_arch_unknown.h, which
contain only #error statements and explanatory comments. This forces
build failures on unrecognized architectures in preference to trying
to guess at what operations might be safe on such architectures.
One other semi-feasible alternative is to use hashed arrays of locks
that are acquired with signals disabled. However, this seems a bit
too ornate, especially for architectures for which the gcc __sync_
primitives work correctly.
Signed-off-by: Paul E. McKenney <paulmck at linux.vnet.ibm.com>
---
configure.ac | 9 ++-------
urcu/arch_unknown.h | 28 ++++++++++++++++++++++++++++
urcu/uatomic_arch_unknown.h | 25 +++++++++++++++++++++++++
3 files changed, 55 insertions(+), 7 deletions(-)
create mode 100644 urcu/arch_unknown.h
create mode 100644 urcu/uatomic_arch_unknown.h
diff --git a/configure.ac b/configure.ac
index 7b46004..4daf3ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,13 +56,8 @@ case $host_cpu in
*) ARCHTYPE="unknown";;
esac
-if test "$ARCHTYPE" != "unknown"; then
- UATOMICSRC=urcu/uatomic_arch_$ARCHTYPE.h
- ARCHSRC=urcu/arch_$ARCHTYPE.h
-else
- UATOMICSRC=urcu/uatomic_generic.h
- ARCHSRC=urcu/arch_generic.h
-fi
+UATOMICSRC=urcu/uatomic_arch_$ARCHTYPE.h
+ARCHSRC=urcu/arch_$ARCHTYPE.h
if test "x$ARCHTYPE" != xx86 -a "x$ARCHTYPE" != xppc; then
APISRC=tests/api_gcc.h
else
diff --git a/urcu/arch_unknown.h b/urcu/arch_unknown.h
new file mode 100644
index 0000000..2de6a6b
--- /dev/null
+++ b/urcu/arch_unknown.h
@@ -0,0 +1,28 @@
+#ifndef _URCU_ARCH_UNKNOWN_H
+#define _URCU_ARCH_UNKNOWN_H
+
+/*
+ * arch_unknown.h: #error to prevent build on unknown architectures.
+ *
+ * Copyright (c) 2010 Paul E. McKenney, IBM Corporation.
+ * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers at polymtl.ca>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/* See configure.ac for the list of recognized architectures. */
+#error "Cannot build: unrecognized architecture detected."
+
+#endif /* _URCU_ARCH_UNKNOWN_H */
diff --git a/urcu/uatomic_arch_unknown.h b/urcu/uatomic_arch_unknown.h
new file mode 100644
index 0000000..6fb4eb3
--- /dev/null
+++ b/urcu/uatomic_arch_unknown.h
@@ -0,0 +1,25 @@
+#ifndef _URCU_ARCH_UATOMIC_UNKNOWN_H
+#define _URCU_ARCH_UATOMIC_UNKNOWN_H
+
+/*
+ * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
+ * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
+ * Copyright (c) 1999-2004 Hewlett-Packard Development Company, L.P.
+ * Copyright (c) 2009 Mathieu Desnoyers
+ * Copyright (c) 2010 Paul E. McKenney, IBM Corporation
+ * (Adapted from uatomic_arch_ppc.h)
+ *
+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+ * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
+ *
+ * Permission is hereby granted to use or copy this program
+ * for any purpose, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ */
+
+/* See configure.ac for the list of recognized architectures. */
+#error "Cannot build: unrecognized architecture detected."
+
+#endif /* _URCU_ARCH_UATOMIC_UNKNOWN_H */
--
1.7.0.6
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ltt-dev] [PATCH tip/core/rcu 1/4] Add header files supporting gcc __sync_ primitives
2010-06-17 4:47 ` [ltt-dev] [PATCH tip/core/rcu 1/4] Add header files supporting gcc __sync_ primitives Paul E. McKenney
@ 2010-06-17 7:55 ` Paolo Bonzini
2010-06-17 16:45 ` Paul E. McKenney
0 siblings, 1 reply; 11+ messages in thread
From: Paolo Bonzini @ 2010-06-17 7:55 UTC (permalink / raw)
+#define CACHE_LINE_SIZE 128
+#define mb() __sync_synchronize()
These are provided by arch_generic.h, aren't they?
In particular, CACHE_LINE_SIZE should be updated there from 64
to 128 if we deem that value to be better.
diff --git a/urcu/uatomic_arch_gcc.h b/urcu/uatomic_arch_gcc.h
new file mode 100644
index 0000000..df208bd
--- /dev/null
+++ b/urcu/uatomic_arch_gcc.h
@@ -0,0 +1,48 @@
+/* xchg */
+#define uatomic_xchg(addr, v) __sync_lock_test_and_set(addr, v)
__sync_lock_test_and_set may only support v==1, and is only
an acquire barrier, so I think it's better to just use the
definition in uatomic_arch_generic.h.
+/* cmpxchg */
+#define uatomic_cmpxchg(addr, old, _new) \
+ __sync_val_compare_and_swap(addr, old, _new)
+
+/* uatomic_add_return */
+#define uatomic_add_return(addr, v) __sync_add_and_fetch(addr, v)
These are also provided by uatomic_arch_generic.h.
Paolo
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ltt-dev] [PATCH tip/core/rcu 1/4] Add header files supporting gcc __sync_ primitives
2010-06-17 7:55 ` Paolo Bonzini
@ 2010-06-17 16:45 ` Paul E. McKenney
0 siblings, 0 replies; 11+ messages in thread
From: Paul E. McKenney @ 2010-06-17 16:45 UTC (permalink / raw)
On Thu, Jun 17, 2010 at 03:55:47AM -0400, Paolo Bonzini wrote:
> +#define CACHE_LINE_SIZE 128
> +#define mb() __sync_synchronize()
>
> These are provided by arch_generic.h, aren't they?
>
> In particular, CACHE_LINE_SIZE should be updated there from 64
> to 128 if we deem that value to be better.
Good point -- I need to prune in favor of arch_generic.h.
Therefore getting rid of both CACHE_LINE_SIZE and mb().
> diff --git a/urcu/uatomic_arch_gcc.h b/urcu/uatomic_arch_gcc.h
> new file mode 100644
> index 0000000..df208bd
> --- /dev/null
> +++ b/urcu/uatomic_arch_gcc.h
> @@ -0,0 +1,48 @@
> +/* xchg */
> +#define uatomic_xchg(addr, v) __sync_lock_test_and_set(addr, v)
>
> __sync_lock_test_and_set may only support v==1, and is only
> an acquire barrier, so I think it's better to just use the
> definition in uatomic_arch_generic.h.
Good point -- I clearly am still catching up with the autoconf
changes to this library! Thank you for bearing with me here.
> +/* cmpxchg */
> +#define uatomic_cmpxchg(addr, old, _new) \
> + __sync_val_compare_and_swap(addr, old, _new)
> +
> +/* uatomic_add_return */
> +#define uatomic_add_return(addr, v) __sync_add_and_fetch(addr, v)
>
> These are also provided by uatomic_arch_generic.h.
What I will do is define both UATOMIC_HAS_ATOMIC_BYTE and
UATOMIC_HAS_ATOMIC_SHORT in uatomic_arch_gcc.h, which allows
leveraging uatomic_arch_generic.h -- no other definitions required.
Of course, the same applies to the ARM stuff...
So letting arch_generic.h define CACHE_LINE_SIZE. I need to keep mb()
in arch_armv7l.h due to the compiler bug. At some point, I should
make this depend on __GNUC__, __GNUC_MINOR__, and __GNUC_PATCHLEVEL__.
Given that ARM supports atomic operations on all sizes up to 32 bits,
seems simplest to just supply the bare __sync_ definitions, so will
leave uatomic_arch_armv7l.h as is for the moment.
Will respin, test, and resend!
Thanx, Paul
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown
2010-06-17 4:47 [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown Paul E. McKenney
` (3 preceding siblings ...)
2010-06-17 4:48 ` [ltt-dev] [PATCH tip/core/rcu 4/4] Force build failure on unknown architectures Paul E. McKenney
@ 2010-06-18 15:46 ` Mathieu Desnoyers
2010-06-18 16:02 ` Mathieu Desnoyers
2010-06-18 16:12 ` Paul E. McKenney
4 siblings, 2 replies; 11+ messages in thread
From: Mathieu Desnoyers @ 2010-06-18 15:46 UTC (permalink / raw)
* Paul E. McKenney (paulmck at linux.vnet.ibm.com) wrote:
> Hello!
Looks good ! Will merge, thanks!
Mathieu
>
> This set of four patches does the following:
>
> o Add header files providing definitions based on the gcc __sync_
> set of primitives.
>
> o Add IA64 support based on the gcc definitions.
>
> o Add native ARMv7L support.
>
> o Force build failures on unknown architectures.
>
> Updates since v1:
>
> o Add note that this works back to at least 2.6.15 kernels.
>
> Thanx, Paul
>
> b/configure.ac | 1
> b/urcu/arch_armv7l.h | 59 ++++++++++++++++++++++++++++++++++++++++++
> b/urcu/arch_gcc.h | 59 ++++++++++++++++++++++++++++++++++++++++++
> b/urcu/arch_unknown.h | 28 +++++++++++++++++++
> b/urcu/uatomic_arch_armv7l.h | 50 +++++++++++++++++++++++++++++++++++
> b/urcu/uatomic_arch_gcc.h | 48 ++++++++++++++++++++++++++++++++++
> b/urcu/uatomic_arch_unknown.h | 25 +++++++++++++++++
> configure.ac | 13 ++++-----
> 8 files changed, 276 insertions(+), 7 deletions(-)
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown
2010-06-18 15:46 ` [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown Mathieu Desnoyers
@ 2010-06-18 16:02 ` Mathieu Desnoyers
2010-06-18 16:13 ` Paul E. McKenney
2010-06-18 16:12 ` Paul E. McKenney
1 sibling, 1 reply; 11+ messages in thread
From: Mathieu Desnoyers @ 2010-06-18 16:02 UTC (permalink / raw)
* Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote:
> * Paul E. McKenney (paulmck at linux.vnet.ibm.com) wrote:
> > Hello!
>
> Looks good ! Will merge, thanks!
(will merge v3 instead) ;)
Mathieu
>
> Mathieu
>
> >
> > This set of four patches does the following:
> >
> > o Add header files providing definitions based on the gcc __sync_
> > set of primitives.
> >
> > o Add IA64 support based on the gcc definitions.
> >
> > o Add native ARMv7L support.
> >
> > o Force build failures on unknown architectures.
> >
> > Updates since v1:
> >
> > o Add note that this works back to at least 2.6.15 kernels.
> >
> > Thanx, Paul
> >
> > b/configure.ac | 1
> > b/urcu/arch_armv7l.h | 59 ++++++++++++++++++++++++++++++++++++++++++
> > b/urcu/arch_gcc.h | 59 ++++++++++++++++++++++++++++++++++++++++++
> > b/urcu/arch_unknown.h | 28 +++++++++++++++++++
> > b/urcu/uatomic_arch_armv7l.h | 50 +++++++++++++++++++++++++++++++++++
> > b/urcu/uatomic_arch_gcc.h | 48 ++++++++++++++++++++++++++++++++++
> > b/urcu/uatomic_arch_unknown.h | 25 +++++++++++++++++
> > configure.ac | 13 ++++-----
> > 8 files changed, 276 insertions(+), 7 deletions(-)
>
> --
> Mathieu Desnoyers
> Operating System Efficiency R&D Consultant
> EfficiOS Inc.
> http://www.efficios.com
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown
2010-06-18 15:46 ` [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown Mathieu Desnoyers
2010-06-18 16:02 ` Mathieu Desnoyers
@ 2010-06-18 16:12 ` Paul E. McKenney
1 sibling, 0 replies; 11+ messages in thread
From: Paul E. McKenney @ 2010-06-18 16:12 UTC (permalink / raw)
On Fri, Jun 18, 2010 at 11:46:54AM -0400, Mathieu Desnoyers wrote:
> * Paul E. McKenney (paulmck at linux.vnet.ibm.com) wrote:
> > Hello!
>
> Looks good ! Will merge, thanks!
Very good!!!
Please note that there is a v3 based on Paolo's later comments, which
prompted some very nice code-size reductions.
Thanx, Paul
> Mathieu
>
> >
> > This set of four patches does the following:
> >
> > o Add header files providing definitions based on the gcc __sync_
> > set of primitives.
> >
> > o Add IA64 support based on the gcc definitions.
> >
> > o Add native ARMv7L support.
> >
> > o Force build failures on unknown architectures.
> >
> > Updates since v1:
> >
> > o Add note that this works back to at least 2.6.15 kernels.
> >
> > Thanx, Paul
> >
> > b/configure.ac | 1
> > b/urcu/arch_armv7l.h | 59 ++++++++++++++++++++++++++++++++++++++++++
> > b/urcu/arch_gcc.h | 59 ++++++++++++++++++++++++++++++++++++++++++
> > b/urcu/arch_unknown.h | 28 +++++++++++++++++++
> > b/urcu/uatomic_arch_armv7l.h | 50 +++++++++++++++++++++++++++++++++++
> > b/urcu/uatomic_arch_gcc.h | 48 ++++++++++++++++++++++++++++++++++
> > b/urcu/uatomic_arch_unknown.h | 25 +++++++++++++++++
> > configure.ac | 13 ++++-----
> > 8 files changed, 276 insertions(+), 7 deletions(-)
>
> --
> Mathieu Desnoyers
> Operating System Efficiency R&D Consultant
> EfficiOS Inc.
> http://www.efficios.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown
2010-06-18 16:02 ` Mathieu Desnoyers
@ 2010-06-18 16:13 ` Paul E. McKenney
0 siblings, 0 replies; 11+ messages in thread
From: Paul E. McKenney @ 2010-06-18 16:13 UTC (permalink / raw)
On Fri, Jun 18, 2010 at 12:02:43PM -0400, Mathieu Desnoyers wrote:
> * Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote:
> > * Paul E. McKenney (paulmck at linux.vnet.ibm.com) wrote:
> > > Hello!
> >
> > Looks good ! Will merge, thanks!
>
> (will merge v3 instead) ;)
Very good, you beat me to it. ;-)
Thanx, Paul
> Mathieu
>
> >
> > Mathieu
> >
> > >
> > > This set of four patches does the following:
> > >
> > > o Add header files providing definitions based on the gcc __sync_
> > > set of primitives.
> > >
> > > o Add IA64 support based on the gcc definitions.
> > >
> > > o Add native ARMv7L support.
> > >
> > > o Force build failures on unknown architectures.
> > >
> > > Updates since v1:
> > >
> > > o Add note that this works back to at least 2.6.15 kernels.
> > >
> > > Thanx, Paul
> > >
> > > b/configure.ac | 1
> > > b/urcu/arch_armv7l.h | 59 ++++++++++++++++++++++++++++++++++++++++++
> > > b/urcu/arch_gcc.h | 59 ++++++++++++++++++++++++++++++++++++++++++
> > > b/urcu/arch_unknown.h | 28 +++++++++++++++++++
> > > b/urcu/uatomic_arch_armv7l.h | 50 +++++++++++++++++++++++++++++++++++
> > > b/urcu/uatomic_arch_gcc.h | 48 ++++++++++++++++++++++++++++++++++
> > > b/urcu/uatomic_arch_unknown.h | 25 +++++++++++++++++
> > > configure.ac | 13 ++++-----
> > > 8 files changed, 276 insertions(+), 7 deletions(-)
> >
> > --
> > Mathieu Desnoyers
> > Operating System Efficiency R&D Consultant
> > EfficiOS Inc.
> > http://www.efficios.com
>
> --
> Mathieu Desnoyers
> Operating System Efficiency R&D Consultant
> EfficiOS Inc.
> http://www.efficios.com
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2010-06-18 16:13 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-17 4:47 [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown Paul E. McKenney
2010-06-17 4:47 ` [ltt-dev] [PATCH tip/core/rcu 1/4] Add header files supporting gcc __sync_ primitives Paul E. McKenney
2010-06-17 7:55 ` Paolo Bonzini
2010-06-17 16:45 ` Paul E. McKenney
2010-06-17 4:47 ` [ltt-dev] [PATCH tip/core/rcu 2/4] Add ia64 architecture based on gcc primitives Paul E. McKenney
2010-06-17 4:47 ` [ltt-dev] [PATCH tip/core/rcu 3/4] Add native ARM port for armv7l Paul E. McKenney
2010-06-17 4:48 ` [ltt-dev] [PATCH tip/core/rcu 4/4] Force build failure on unknown architectures Paul E. McKenney
2010-06-18 15:46 ` [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown Mathieu Desnoyers
2010-06-18 16:02 ` Mathieu Desnoyers
2010-06-18 16:13 ` Paul E. McKenney
2010-06-18 16:12 ` Paul E. McKenney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox