Skip to content

locking/atomic: convert all architectures to ARCH_ATOMIC

Mark Rutland linux-snps-arc lkml 2 versions – Applied

Status from this message: The following commit has been merged into the locking/core branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest33 patches 15 repliesApplied
  2. v133 patches 23 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/33locking/atomic: make ARCH_ATOMIC a Kconfig symbolarch/Kconfig arch/arm64/Kconfig arch/arm64/include/asm/atomic.h +6 more+8 -70 replies
2/33locking/atomic: net: use linux/atomic.h for xchg & cmpxchgnet/core/filter.c net/sunrpc/xprtmultipath.c+2 -20 replies
3/33locking/atomic: h8300: use asm-generic exclusivelyarch/h8300/include/asm/Kbuild arch/h8300/include/asm/atomic.h arch/h8300/include/asm/cmpxchg.h+1 -00 replies
4/33locking/atomic: microblaze: use asm-generic exclusivelyarch/microblaze/include/asm/Kbuild arch/microblaze/include/asm/atomic.h arch/microblaze/include/asm/cmpxchg.h+1 -01 reply
5/33locking/atomic: openrisc: avoid asm-generic/atomic.harch/openrisc/include/asm/atomic.h+7 -10 replies
6/33locking/atomic: atomic: remove stale commentsinclude/asm-generic/atomic.h+2 -370 replies
7/33locking/atomic: atomic: remove redundant includeinclude/asm-generic/atomic.h+0 -20 replies
8/33locking/atomic: atomic: simplify ifdefferyinclude/asm-generic/atomic.h+4 -420 replies
9/33locking/atomic: atomic: support ARCH_ATOMICinclude/asm-generic/atomic.h+62 -90 replies
10/33locking/atomic: atomic64: support ARCH_ATOMICinclude/asm-generic/atomic64.h lib/atomic64.c+79 -310 replies
11/33locking/atomic: cmpxchg: make `generic` a prefixarch/arm/include/asm/cmpxchg.h arch/m68k/include/asm/cmpxchg.h arch/mips/include/asm/cmpxchg.h +7 more+18 -180 replies
12/33locking/atomic: cmpxchg: support ARCH_ATOMICinclude/asm-generic/cmpxchg.h+44 -170 replies
13/33locking/atomic: alpha: move to ARCH_ATOMICarch/alpha/Kconfig arch/alpha/include/asm/atomic.h arch/alpha/include/asm/cmpxchg.h+54 -470 replies
14/33locking/atomic: arc: move to ARCH_ATOMICarch/arc/Kconfig arch/arc/include/asm/atomic.h arch/arc/include/asm/cmpxchg.h+36 -350 replies
15/33locking/atomic: arm: move to ARCH_ATOMICarch/arm/Kconfig arch/arm/include/asm/atomic.h arch/arm/include/asm/cmpxchg.h +1 more+58 -570 replies
16/33locking/atomic: csky: move to ARCH_ATOMICarch/csky/Kconfig arch/csky/include/asm/cmpxchg.h+5 -40 replies
17/33locking/atomic: h8300: move to ARCH_ATOMICarch/h8300/Kconfig+1 -00 replies
18/33locking/atomic: hexagon: move to ARCH_ATOMICarch/hexagon/Kconfig arch/hexagon/include/asm/atomic.h arch/hexagon/include/asm/cmpxchg.h+17 -160 replies
19/33locking/atomic: ia64: move to ARCH_ATOMICarch/ia64/Kconfig arch/ia64/include/asm/atomic.h arch/ia64/include/asm/cmpxchg.h +1 more+61 -400 replies
20/33locking/atomic: m68k: move to ARCH_ATOMICarch/m68k/Kconfig arch/m68k/include/asm/atomic.h arch/m68k/include/asm/cmpxchg.h +1 more+37 -360 replies
21/33locking/atomic: microblaze: move to ARCH_ATOMICarch/microblaze/Kconfig+1 -01 reply
22/33locking/atomic: mips: move to ARCH_ATOMICarch/mips/Kconfig arch/mips/include/asm/atomic.h arch/mips/include/asm/cmpxchg.h +1 more+43 -390 replies
23/33locking/atomic: nds32: move to ARCH_ATOMICarch/nds32/Kconfig+1 -00 replies
24/33locking/atomic: nios2: move to ARCH_ATOMICarch/nios2/Kconfig+1 -00 replies
25/33locking/atomic: openrisc: move to ARCH_ATOMICarch/openrisc/Kconfig arch/openrisc/include/asm/atomic.h arch/openrisc/include/asm/cmpxchg.h+26 -210 replies
26/33locking/atomic: parisc: move to ARCH_ATOMICarch/parisc/Kconfig arch/parisc/include/asm/atomic.h arch/parisc/include/asm/cmpxchg.h+24 -230 replies
27/33locking/atomic: powerpc: move to ARCH_ATOMICarch/powerpc/Kconfig arch/powerpc/include/asm/atomic.h arch/powerpc/include/asm/cmpxchg.h +1 more+90 -830 replies
28/33locking/atomic: riscv: move to ARCH_ATOMICarch/riscv/Kconfig arch/riscv/include/asm/atomic.h arch/riscv/include/asm/cmpxchg.h+82 -810 replies
29/33locking/atomic: sh: move to ARCH_ATOMICarch/sh/Kconfig arch/sh/include/asm/atomic-grb.h arch/sh/include/asm/atomic-irq.h +3 more+16 -150 replies
30/33locking/atomic: sparc: move to ARCH_ATOMICarch/sparc/Kconfig arch/sparc/include/asm/atomic_32.h arch/sparc/include/asm/atomic_64.h +4 more+81 -800 replies
31/33locking/atomic: xtensa: move to ARCH_ATOMICarch/xtensa/Kconfig arch/xtensa/include/asm/atomic.h arch/xtensa/include/asm/cmpxchg.h+19 -180 replies
32/33locking/atomic: delete !ARCH_ATOMIC remnantsarch/Kconfig arch/alpha/Kconfig arch/arc/Kconfig +28 more+3 -1230 replies
33/33locking/atomics: atomic-instrumented: simplify ifdefferyinclude/asm-generic/atomic-instrumented.h scripts/atomic/gen-atomic-instrumented.sh+3 -5460 replies

Reviews trailers per patch

11 of 33 patches have a Reviewed-by or Acked-by.

PatchStafford HorneGeert UytterhoevenVineet GuptaGuo RenGreg UngererPalmer DabbeltMax FilippovMichal Simek
1/33
2/33
3/33
4/33A-b
5/33A-b
6/33
7/33
8/33
9/33
10/33
11/33A-b
12/33
13/33
14/33A-b
15/33
16/33A-b
17/33
18/33
19/33
20/33R-b A-b A-b
21/33A-b
22/33
23/33
24/33
25/33A-b
26/33
27/33
28/33R-b A-b
29/33
30/33
31/33A-b
32/33A-b
33/33

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 8 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/33] locking/atomic: convert all architectures to ARCH_ATOMIC

This series (based on v5.13-rc2) converts all architectures to ARCH_ATOMIC. This will allow the use of instrumented atomics on all architectures (e.g. for KASAN and similar), and simplifies the core atomic code (which should allow for easier rework of the fallbacks and other bits in future).

I'm hoping that we can queue this via the tip tree for v5.14.

I've build-tested this with the kernel.org crosstool GCC 10.3.0 binaries (all arches except hexagon), and I haven't seen issues with the configs I tried, so I'm fairly confident this is solid now. I'd like to get this into linux-next ASAP to flush out any remaining issues.

The series is split into three parts:

1) Some preparatory work is done to prepare architectures and common code for the conversion. In this phase h8300 and microblaze are converted to use the asm-generic atomics exclusively, and the asm-generic implementations are made to function with or without ARCH_ATOMIC.

2) Architectures are converted one-by-one to use the ARCH_ATOMIC interface. I've converted each architecture with its own patch (even where the conversion is trivial) to make review and bisection easier.

3) The code handling !ARCH_ATOMIC is removed.

Note: I've generated the patches with:

git format-patch -C -M -D

... so the preimage of include/linux/atomic-fallback.h is not included in the diff when it is deleted.

The series can also be found in my atomics/arch-atomic branch on kernel.org:

https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=atomics/arch-atomic
git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git atomics/arch-atomic

This version is tagged as arch-atomic-20210525.

Since v1 [1]:
* Rebase to v5.13-rc2
* Accumulate Acked-by / Reviewed-by tags
* Correct missing arch_ prefixes
* Fix missing preprocessor glue

[1] https://lore.kernel.org/r/[email protected]

Thanks,
Mark.

Mark Rutland (33):
locking/atomic: make ARCH_ATOMIC a Kconfig symbol locking/atomic: net: use linux/atomic.h for xchg & cmpxchg locking/atomic: h8300: use asm-generic exclusively locking/atomic: microblaze: use asm-generic exclusively locking/atomic: openrisc: avoid asm-generic/atomic.h locking/atomic: atomic: remove stale comments locking/atomic: atomic: remove redundant include locking/atomic: atomic: simplify ifdeffery locking/atomic: atomic: support ARCH_ATOMIC locking/atomic: atomic64: support ARCH_ATOMIC locking/atomic: cmpxchg: make generic a prefix locking/atomic: cmpxchg: support ARCH_ATOMIC locking/atomic: alpha: move to ARCH_ATOMIC locking/atomic: arc: move to ARCH_ATOMIC locking/atomic: arm: move to ARCH_ATOMIC locking/atomic: csky: move to ARCH_ATOMIC locking/atomic: h8300: move to ARCH_ATOMIC locking/atomic: hexagon: move to ARCH_ATOMIC locking/atomic: ia64: move to ARCH_ATOMIC locking/atomic: m68k: move to ARCH_ATOMIC locking/atomic: microblaze: move to ARCH_ATOMIC locking/atomic: mips: move to ARCH_ATOMIC locking/atomic: nds32: move to ARCH_ATOMIC locking/atomic: nios2: move to ARCH_ATOMIC locking/atomic: openrisc: move to ARCH_ATOMIC locking/atomic: parisc: move to ARCH_ATOMIC locking/atomic: powerpc: move to ARCH_ATOMIC locking/atomic: riscv: move to ARCH_ATOMIC locking/atomic: sh: move to ARCH_ATOMIC locking/atomic: sparc: move to ARCH_ATOMIC locking/atomic: xtensa: move to ARCH_ATOMIC locking/atomic: delete !ARCH_ATOMIC remnants locking/atomics: atomic-instrumented: simplify ifdeffery

 arch/alpha/include/asm/atomic.h           |   88 +-
 arch/alpha/include/asm/cmpxchg.h          |   12 +-
 arch/arc/include/asm/atomic.h             |   60 +-
 arch/arc/include/asm/cmpxchg.h            |   10 +-
 arch/arm/include/asm/atomic.h             |   96 +-
 arch/arm/include/asm/cmpxchg.h            |   20 +-
 arch/arm/include/asm/sync_bitops.h        |    2 +-
 arch/arm64/include/asm/atomic.h           |    2 -
 arch/csky/include/asm/cmpxchg.h           |    8 +-
 arch/h8300/include/asm/Kbuild             |    1 +
 arch/h8300/include/asm/atomic.h           |   97 --
 arch/h8300/include/asm/cmpxchg.h          |   66 -
 arch/hexagon/include/asm/atomic.h         |   28 +-
 arch/hexagon/include/asm/cmpxchg.h        |    4 +-
 arch/ia64/include/asm/atomic.h            |   74 +-
 arch/ia64/include/asm/cmpxchg.h           |   16 +
 arch/ia64/include/uapi/asm/cmpxchg.h      |   10 +-
 arch/m68k/include/asm/atomic.h            |   60 +-
 arch/m68k/include/asm/cmpxchg.h           |   10 +-
 arch/m68k/include/asm/mmu_context.h       |    2 +-
 arch/microblaze/include/asm/Kbuild        |    1 +
 arch/microblaze/include/asm/atomic.h      |   28 -
 arch/microblaze/include/asm/cmpxchg.h     |    9 -
 arch/mips/include/asm/atomic.h            |   55 +-
 arch/mips/include/asm/cmpxchg.h           |   22 +-
 arch/mips/kernel/cmpxchg.c                |    4 +-
 arch/openrisc/include/asm/atomic.h        |   42 +-
 arch/openrisc/include/asm/cmpxchg.h       |    4 +-
 arch/parisc/include/asm/atomic.h          |   34 +-
 arch/parisc/include/asm/cmpxchg.h         |   14 +-
 arch/powerpc/include/asm/atomic.h         |  140 +-
 arch/powerpc/include/asm/cmpxchg.h        |   30 +-
 arch/powerpc/include/asm/qspinlock.h      |    2 +-
 arch/riscv/include/asm/atomic.h           |  128 +-
 arch/riscv/include/asm/cmpxchg.h          |   34 +-
 arch/s390/include/asm/atomic.h            |    2 -
 arch/sh/include/asm/atomic-grb.h          |    6 +-
 arch/sh/include/asm/atomic-irq.h          |    6 +-
 arch/sh/include/asm/atomic-llsc.h         |    6 +-
 arch/sh/include/asm/atomic.h              |    8 +-
 arch/sh/include/asm/cmpxchg.h             |    4 +-
 arch/sparc/include/asm/atomic_32.h        |   38 +-
 arch/sparc/include/asm/atomic_64.h        |   36 +-
 arch/sparc/include/asm/cmpxchg_32.h       |   12 +-
 arch/sparc/include/asm/cmpxchg_64.h       |   12 +-
 arch/sparc/lib/atomic32.c                 |   24 +-
 arch/sparc/lib/atomic_64.S                |   42 +-
 arch/x86/include/asm/atomic.h             |    2 -
 arch/xtensa/include/asm/atomic.h          |   26 +-
 arch/xtensa/include/asm/cmpxchg.h         |   14 +-
 include/asm-generic/atomic-instrumented.h |  498 +-----
 include/asm-generic/atomic.h              |  118 +-
 include/asm-generic/atomic64.h            |   45 +-
 include/asm-generic/cmpxchg-local.h       |    4 +-
 include/asm-generic/cmpxchg.h             |   42 +-
 include/linux/atomic-fallback.h           | 2595 -----------------------------
 include/linux/atomic.h                    |    4 -
 lib/atomic64.c                            |   36 +-
 net/core/filter.c                         |    2 +-
 net/sunrpc/xprtmultipath.c                |    2 +-
 scripts/atomic/check-atomics.sh           |    1 -
 scripts/atomic/gen-atomic-instrumented.sh |   51 +-
 scripts/atomic/gen-atomics.sh             |    1 -
 63 files changed, 756 insertions(+), 4094 deletions(-)
 delete mode 100644 arch/h8300/include/asm/atomic.h
 delete mode 100644 arch/h8300/include/asm/cmpxchg.h
 create mode 100644 arch/ia64/include/asm/cmpxchg.h
 delete mode 100644 arch/microblaze/include/asm/atomic.h
 delete mode 100644 arch/microblaze/include/asm/cmpxchg.h
 delete mode 100644 include/linux/atomic-fallback.h
Signature · 1 line
2.11.0