[ltt-dev] [PATCH 00/11] Simplify system dependent URCU code

Paolo Bonzini pbonzini at redhat.com
Sat Feb 13 12:16:20 EST 2010


This patch series simplifies the system dependent code in the
userspace RCU library by removing redundant definitions and
moving them to common code.  The common code is then less
subject to bitrotting because it can be tested on x86 too.

Patches 1 and 2 are simple Makefile cleanups.

Patches 3 and 4 take care of urcu/arch_*.  Definitions for
rmb/wmb/mc/rmc/wmc can often be omitted, and even mb can
for example defer to the compiler-provided __sync_synchronize.

Patch 5 removes a redundant definition that is probably
a residual of libatomicops, and so does patch 6.

Patches 7 to 9 take care of urcu/uatomic_arch_*, by defining
fallbacks using __sync_* builtins.  S390 can use them completely
without basically changing the generated code, while other
architectures still require a little help.

Patches 10 and 11 show how this helps by supporting
compilation to unknown architectures that support GCC
builtins (MIPS and IA64 are serviced nicely for example),
and by supporting Alpha (obviously chosen as an example of
read_barrier_depends) with ~20 lines of non-comment code.

Patch 12 is not meant to be committed, but was used to test
the atomic op implementations on x86_64.  It is not counted
in the diffstat below.

HTH,

Paolo

Paolo Bonzini (11+1):
  use kernel style makefile output
  use autoconf symbolic linking
  add urcu/arch_defaults.h
  define sync_core for x86 PIC
  __SIZEOF_LONG__ is always defined by GCC
  remove compat_uatomic_cmpxchg #define from non-x86
  add uatomic_gcc.h, use it for default definitions
  use uatomic_gcc.h
  move whether atomic byte/short exists to uatomic_arch_*.h
  add Alpha support
  support compiling on unknown architectures
  test uatomic_gcc.h

 Makefile.am                 |   14 +-
 configure.ac                |   15 ++-
 tests/test_uatomic.c        |   15 +-
 urcu/arch_alpha.h           |   49 +++++
 urcu/arch_defaults.h        |  109 ++++++++++
 urcu/arch_ppc.h             |   50 +-----
 urcu/arch_s390.h            |   46 +----
 urcu/arch_sparc64.h         |   51 +-----
 urcu/arch_x86.h             |   68 +------
 urcu/uatomic_arch_alpha.h   |   32 +++
 urcu/uatomic_arch_ppc.h     |  143 +-------------
 urcu/uatomic_arch_s390.h    |  193 +------------------
 urcu/uatomic_arch_sparc64.h |  109 +----------
 urcu/uatomic_arch_x86.h     |   37 ++----
 urcu/uatomic_gcc.h          |  293 +++++++++++++++++++++++++++++++++++++++++++
 15 files changed, 538 insertions(+), 686 deletions(-)
 create mode 100644 urcu/arch_alpha.h
 create mode 100644 urcu/arch_defaults.h
 create mode 100644 urcu/uatomic_arch_alpha.h
 create mode 100644 urcu/uatomic_gcc.h





More information about the lttng-dev mailing list