Skip to content

Introduce cmpxchg128() -- aka. the demise of cmpxchg_double()

Peter Zijlstra linux-arch linux-crypto linux-doc linux-iommu linux-mm linux-parisc linux-s390 lkml 3 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. v3 Latest11 patches 13 repliesApplied
  2. v210 patches 20 repliesSuperseded
  3. v1 RFC12 patches 44 repliesSuperseded

Changes in v3 from the cover letter

- reworked this_cpu_cmpxchg() to not implicity do u128 but provide explicit this_cpu_cmpxchg128() (arnd)
- added try_cmpxchg12_local() (per the addition of the try_cmpxchg*_local() family of functions)
- slight cleanup of the SLUB conversion (due to rebase and having to touch it)
- added a 'cleanup' patch for SLUB, since I was staring at that anyway

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/11cyrpto/b128ops: Remove struct u128include/crypto/b128ops.h+3 -110 replies
2/11types: Introduce [us]128include/linux/types.h include/uapi/linux/types.h lib/crypto/curve25519-hacl64.c +1 more+9 -40 replies
3/11arch: Introduce arch_{,try_}_cmpxchg128{,_local}()arch/arm64/include/asm/atomic_ll_sc.h arch/arm64/include/asm/atomic_lse.h arch/arm64/include/asm/cmpxchg.h +3 more+177 -20 replies
4/11instrumentation: Wire up cmpxchg128()include/linux/atomic/atomic-arch-fallback.h include/linux/atomic/atomic-instrumented.h scripts/atomic/gen-atomic-fallback.sh +1 more+183 -60 replies
5/11percpu: Wire up cmpxchg128arch/arm64/include/asm/percpu.h arch/s390/include/asm/percpu.h arch/x86/include/asm/percpu.h +1 more+111 -02 replies
6/11x86,amd_iommu: Replace cmpxchg_double()drivers/iommu/amd/amd_iommu_types.h drivers/iommu/amd/iommu.c+11 -80 replies
7/11x86,intel_iommu: Replace cmpxchg_double()drivers/iommu/intel/irq_remapping.c include/linux/dmar.h+68 -650 replies
8/11slub: Replace cmpxchg_double()include/linux/slub_def.h mm/slab.h mm/slub.c+138 -667 replies
9/11mm/slub: Fold slab_update_freelist()mm/slub.c+28 -521 reply
10/11arch: Remove cmpxchg_doubleDocumentation/core-api/this_cpu_ops.rst arch/arm64/include/asm/atomic_ll_sc.h arch/arm64/include/asm/atomic_lse.h +12 more+5 -3701 reply
11/11s390/cpum_sf: Convert to cmpxchg128()arch/s390/include/asm/cpu_mf.h arch/s390/kernel/perf_cpum_sf.c+4 -140 replies

Reviews trailers per patch

8 of 11 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchHerbert XuHeiko CarstensVlastimil BabkaHyeonggon YooMark RutlandLu BaoluVasant HegdeArnd Bergmann
SeriesR-b
1/11A-b
2/11A-b
3/11A-b A-b
4/11A-b
5/11
6/11T-b
7/11R-b
8/11A-b A-b
9/11
10/11A-b
11/11A-b

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 v3 thread

Cover letter [PATCH v3 00/11] Introduce cmpxchg128() -- aka. the demise of cmpxchg_double()

Hi!

I seem to have forgotten to post this series last release; so here goes. I'm really hoping to merge it and forget about it.

Since Linus hated on cmpxchg_double(), a few patches to get rid of it, as proposed here:

https://lkml.kernel.org/r/[email protected]

These patches are based on 6.4.0-rc2.

Available here:

git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git core/wip-u128

Since v2:

- reworked this_cpu_cmpxchg() to not implicity do u128 but provide explicit this_cpu_cmpxchg128() (arnd)
- added try_cmpxchg12_local() (per the addition of the try_cmpxchg*_local() family of functions)
- slight cleanup of the SLUB conversion (due to rebase and having to touch it)
- added a 'cleanup' patch for SLUB, since I was staring at that anyway

Since v1:

- rebaed on Eric's ghash cleanups (hence the cryptodev-2.6 dependency)
- rebased on Heiko's s390/cpum_sf CDSG patch
- fixed up a bunch of arch code
- fixed up the inline asm to use 'u128 *' mem argument so the compiler knows how wide the modification is.
- reworked the percpu thing to use union based type-punning instead of _Generic() based casts.

---
 Documentation/core-api/this_cpu_ops.rst     |   2 -
 arch/arm64/include/asm/atomic_ll_sc.h       |  56 ++++----
 arch/arm64/include/asm/atomic_lse.h         |  39 +++---
 arch/arm64/include/asm/cmpxchg.h            |  48 ++-----
 arch/arm64/include/asm/percpu.h             |  30 +++--
 arch/s390/include/asm/cmpxchg.h             |  32 +----
 arch/s390/include/asm/cpu_mf.h              |   2 +-
 arch/s390/include/asm/percpu.h              |  34 +++--
 arch/s390/kernel/perf_cpum_sf.c             |  16 +--
 arch/x86/include/asm/cmpxchg.h              |  25 ----
 arch/x86/include/asm/cmpxchg_32.h           |   2 +-
 arch/x86/include/asm/cmpxchg_64.h           |  63 ++++++++-
 arch/x86/include/asm/percpu.h               | 100 +++++++++------
 drivers/iommu/amd/amd_iommu_types.h         |   9 +-
 drivers/iommu/amd/iommu.c                   |  10 +-
 drivers/iommu/intel/irq_remapping.c         |   8 +-
 include/asm-generic/percpu.h                |  66 ++--------
 include/crypto/b128ops.h                    |  14 +-
 include/linux/atomic/atomic-arch-fallback.h |  95 +++++++++++++-
 include/linux/atomic/atomic-instrumented.h  |  93 ++++++++++++--
 include/linux/dmar.h                        | 125 +++++++++---------
 include/linux/percpu-defs.h                 |  38 ------
 include/linux/slub_def.h                    |  12 +-
 include/linux/types.h                       |   5 +
 include/uapi/linux/types.h                  |   4 +
 lib/crypto/curve25519-hacl64.c              |   2 -
 lib/crypto/poly1305-donna64.c               |   2 -
 mm/slab.h                                   |  49 ++++++-
 mm/slub.c                                   | 191 ++++++++++++++--------------
 scripts/atomic/gen-atomic-fallback.sh       |   4 +-
 scripts/atomic/gen-atomic-instrumented.sh   |  19 +--
 31 files changed, 667 insertions(+), 528 deletions(-)