[PATCH 00/22] Cleanup internal atomic definitions

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Tue Oct 7 17:03:38 GMT 2025


Ping.

On 11/09/25 10:49, Adhemerval Zanella wrote:
> This patchset is based on previous work by Wilco [1] [2] to move all
> targets' C11 atomics and remove the unused and redundant atomic
> definitions.
> 
> I took a more conservative approach and kept some arch-specific
> definitions on some targets:
> 
>   * alpha uses a ‘wmb’ for the atomic_write_barrier, and the instruction
>     does not map to any C11 memory ordering.  Alpha has a peculiar
>     semantic memory, so it's best to keep it.
> 
>   * sparc also defines stronger definitions for all barriers.  I am not
>     sure why a strong ordering was used, nor do I have a Sparc machine
>     readily available to check if replacing it with a C11 barrier would
>     be okay, so I will keep it.
> 
>   * RISC-V defines optimized atomic_max and atomic_min, which are used in
>     some statistical collection on malloc.  It also defines an
>     atomic_spin_nop, used on pthread spinlocks and adaptive mutexes.
> 
>   * x86 defines an atomic_spin_nop.
> 
> [1] https://sourceware.org/pipermail/libc-alpha/2022-July/140817.html
> [2] https://sourceware.org/pipermail/libc-alpha/2022-July/140817.html
> 
> Adhemerval Zanella (20):
>   aarch64: Remove ununsed atomic macros
>   arc: Remove ununsed atomic macros
>   csky: Remove ununsed atomic macros
>   mips: Remove ununsed atomic macros
>   or1k: Remove ununsed atomic macros
>   s390: Remove ununsed atomic macros
>   sparc: Remove ununsed atomic macros
>   x86: Remove ununsed atomic macros
>   arm: Consolidade atomic-machine.h and Remove ununsed atomic macros
>   hppa: Move atomic-machine to generic sysdep
>   m68k: Consolidade atomic-machine.h and Remove ununsed atomic macros
>   loongarch: Consolidate atomic-machine.h and remove ununsed atomic
>     macros
>   powerpc: Consolidate atomic-machine.h
>   riscv: Consolidade atomic-machine.h and remove ununsed atomic macros
>   sh: Move atomic-machine to generic sysdep
>   alpha: Remove USE_ATOMIC_COMPILER_BUILTINS definition
>   microblaze: Remove USE_ATOMIC_COMPILER_BUILTINS definition
>   atomic: Consolidate atomic_full_barrier implementation
>   atomic: Consolidate atomic_read_barrier implementation
>   atomic: Consolidate atomic_write_barrier implementation
> 
> Wilco Dijkstra (2):
>   Define __HAVE_64B_ATOMICS from compiler support
>   nptl: Remove ATOMIC_EXCHANGE_USES_CAS usage
> 
>  config.h.in                                   |   3 +
>  configure                                     |  42 ++++
>  configure.ac                                  |  27 +++
>  include/atomic.h                              |  19 +-
>  nptl/pthread_spin_lock.c                      |  19 +-
>  nptl/pthread_spin_trylock.c                   |  49 -----
>  sysdeps/aarch64/atomic-machine.h              | 153 ---------------
>  sysdeps/alpha/atomic-machine.h                |   8 -
>  sysdeps/arc/atomic-machine.h                  |  57 ------
>  sysdeps/arm/atomic-machine.h                  | 138 -------------
>  sysdeps/csky/atomic-machine.h                 |  67 -------
>  sysdeps/generic/atomic-machine.h              |  34 ++--
>  sysdeps/generic/malloc-machine.h              |  12 --
>  sysdeps/m68k/coldfire/atomic-machine.h        |  28 ---
>  sysdeps/m68k/m680x0/m68020/atomic-machine.h   |  22 ---
>  sysdeps/microblaze/atomic-machine.h           |  25 ---
>  sysdeps/mips/atomic-machine.h                 | 184 ------------------
>  sysdeps/mips/sys/asm.h                        |  16 --
>  sysdeps/or1k/atomic-machine.h                 |  71 -------
>  sysdeps/powerpc/atomic-machine.h              |  40 ----
>  sysdeps/powerpc/nptl/pthread_spin_lock.c      |   9 +
>  sysdeps/powerpc/nptl/pthread_spin_trylock.c   |   9 +
>  sysdeps/powerpc/powerpc32/atomic-machine.h    |  65 -------
>  sysdeps/powerpc/powerpc64/atomic-machine.h    |  53 -----
>  sysdeps/riscv/atomic-machine.h                |  51 +++++
>  sysdeps/s390/atomic-machine.h                 | 133 -------------
>  sysdeps/sparc/atomic-machine.h                |  33 ----
>  sysdeps/unix/sysv/linux/arm/atomic-machine.h  | 115 -----------
>  sysdeps/unix/sysv/linux/hppa/atomic-machine.h |  29 ---
>  .../sysv/linux/loongarch/atomic-machine.h     | 147 --------------
>  .../sysv/linux/m68k/coldfire/atomic-machine.h |  35 ----
>  .../unix/sysv/linux/riscv/atomic-machine.h    | 184 ------------------
>  sysdeps/unix/sysv/linux/sh/atomic-machine.h   |  23 ---
>  sysdeps/x86/atomic-machine.h                  |  41 ----
>  34 files changed, 160 insertions(+), 1781 deletions(-)
>  delete mode 100644 sysdeps/aarch64/atomic-machine.h
>  delete mode 100644 sysdeps/arc/atomic-machine.h
>  delete mode 100644 sysdeps/arm/atomic-machine.h
>  delete mode 100644 sysdeps/csky/atomic-machine.h
>  delete mode 100644 sysdeps/m68k/coldfire/atomic-machine.h
>  delete mode 100644 sysdeps/m68k/m680x0/m68020/atomic-machine.h
>  delete mode 100644 sysdeps/microblaze/atomic-machine.h
>  delete mode 100644 sysdeps/mips/atomic-machine.h
>  delete mode 100644 sysdeps/or1k/atomic-machine.h
>  delete mode 100644 sysdeps/powerpc/atomic-machine.h
>  delete mode 100644 sysdeps/powerpc/powerpc32/atomic-machine.h
>  delete mode 100644 sysdeps/powerpc/powerpc64/atomic-machine.h
>  create mode 100644 sysdeps/riscv/atomic-machine.h
>  delete mode 100644 sysdeps/s390/atomic-machine.h
>  delete mode 100644 sysdeps/unix/sysv/linux/arm/atomic-machine.h
>  delete mode 100644 sysdeps/unix/sysv/linux/hppa/atomic-machine.h
>  delete mode 100644 sysdeps/unix/sysv/linux/loongarch/atomic-machine.h
>  delete mode 100644 sysdeps/unix/sysv/linux/m68k/coldfire/atomic-machine.h
>  delete mode 100644 sysdeps/unix/sysv/linux/riscv/atomic-machine.h
>  delete mode 100644 sysdeps/unix/sysv/linux/sh/atomic-machine.h
> 



More information about the Libc-alpha mailing list