This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 0/5] Add generic atomic.h implementation

This patch series adds a generic implementation of atomic.h that uses
modern GCC intrinsics to implement a range of atomic_* and catomic_*
functions in a reasonably efficient manner.

The generic header is based on the AArch64 implementation so there is
little change to the generated code on or performance on that architecture.
The ARM code is improved somewhat due to the richer array of atomicity
intrinsics used and sees reduced code size and an improvement on the malloc

The first patch adds a malloc microbenchmark which this time includes
the threaded variants of the benchmark. I have included these this time
as the benchmark results are also interesting in threaded scenarios
once you start implementing single-thread optimizations for catomic_*.

The second patch adds the generic atomic.h header and the third adds
an atomic_types.h header which should allow reducing repetition in
the various port atomic.h headers, whether they use the new generic
implementation for atomicity or not. If accepted a future series would
carry out this consolidation.

The fourth and fifth patches convert the AArch64 and ARM ports
respectively to use the new generic headers.

Will Newton (5):
  benchtests: Add malloc microbenchmark
  sysdeps/generic/atomic.h: Add a generic atomic header
  sysdeps/generic/atomic_types.h: Add generic atomic types header
  sysdeps/aarch64/bits/atomic.h: Switch to generic implementation
  sysdeps/arm/bits/atomic.h: Switch to generic implementation

 benchtests/Makefile              |  20 ++-
 benchtests/bench-malloc-thread.c | 302 +++++++++++++++++++++++++++++++++++++++
 sysdeps/aarch64/bits/atomic.h    | 151 +-------------------
 sysdeps/arm/bits/atomic.h        |  99 ++-----------
 sysdeps/generic/atomic.h         | 240 +++++++++++++++++++++++++++++++
 sysdeps/generic/atomic_types.h   |  44 ++++++
 6 files changed, 614 insertions(+), 242 deletions(-)
 create mode 100644 benchtests/bench-malloc-thread.c
 create mode 100644 sysdeps/generic/atomic.h
 create mode 100644 sysdeps/generic/atomic_types.h


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]