Merge tag 'locking-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 27 Jun 2023 21:14:30 +0000 (14:14 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 27 Jun 2023 21:14:30 +0000 (14:14 -0700)
Pull locking updates from Ingo Molnar:

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

   The cmpxchg128() family of functions is basically & functionally the
   same as cmpxchg_double(), but with a saner interface.

   Instead of a 6-parameter horror that forced u128 - u64/u64-halves
   layout details on the interface and exposed users to complexity,
   fragility & bugs, use a natural 3-parameter interface with u128
   types.

 - Restructure the generated atomic headers, and add kerneldoc comments
   for all of the generic atomic{,64,_long}_t operations.

   The generated definitions are much cleaner now, and come with
   documentation.

 - Implement lock_set_cmp_fn() on lockdep, for defining an ordering when
   taking multiple locks of the same type.

   This gets rid of one use of lockdep_set_novalidate_class() in the
   bcache code.

 - Fix raw_cpu_generic_try_cmpxchg() bug due to an unintended variable
   shadowing generating garbage code on Clang on certain ARM builds.

* tag 'locking-core-2023-06-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (43 commits)
  locking/atomic: scripts: fix ${atomic}_dec_if_positive() kerneldoc
  percpu: Fix self-assignment of __old in raw_cpu_generic_try_cmpxchg()
  locking/atomic: treewide: delete arch_atomic_*() kerneldoc
  locking/atomic: docs: Add atomic operations to the driver basic API documentation
  locking/atomic: scripts: generate kerneldoc comments
  docs: scripts: kernel-doc: accept bitwise negation like ~@var
  locking/atomic: scripts: simplify raw_atomic*() definitions
  locking/atomic: scripts: simplify raw_atomic_long*() definitions
  locking/atomic: scripts: split pfx/name/sfx/order
  locking/atomic: scripts: restructure fallback ifdeffery
  locking/atomic: scripts: build raw_atomic_long*() directly
  locking/atomic: treewide: use raw_atomic*_<op>()
  locking/atomic: scripts: add trivial raw_atomic*_<op>()
  locking/atomic: scripts: factor out order template generation
  locking/atomic: scripts: remove leftover "${mult}"
  locking/atomic: scripts: remove bogus order parameter
  locking/atomic: xtensa: add preprocessor symbols
  locking/atomic: x86: add preprocessor symbols
  locking/atomic: sparc: add preprocessor symbols
  locking/atomic: sh: add preprocessor symbols
  ...

1  2 
arch/x86/kernel/alternative.c
arch/x86/kernel/cpu/mce/core.c
arch/x86/kvm/x86.c
drivers/iommu/amd/iommu.c
drivers/md/bcache/btree.c
drivers/md/bcache/btree.h
include/linux/lockdep.h
include/linux/lockdep_types.h
kernel/locking/lockdep.c
kernel/sched/clock.c
scripts/min-tool-version.sh

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -442,11 -432,16 +442,19 @@@ extern int lockdep_is_held(const void *
  #define lockdep_repin_lock(l, c)              do { (void)(l); (void)(c); } while (0)
  #define lockdep_unpin_lock(l, c)              do { (void)(l); (void)(c); } while (0)
  
 +#define DEFINE_WAIT_OVERRIDE_MAP(_name, _wait_type)   \
 +      struct lockdep_map __maybe_unused _name = {}
 +
  #endif /* !LOCKDEP */
  
+ #ifdef CONFIG_PROVE_LOCKING
+ void lockdep_set_lock_cmp_fn(struct lockdep_map *, lock_cmp_fn, lock_print_fn);
+ #define lock_set_cmp_fn(lock, ...)    lockdep_set_lock_cmp_fn(&(lock)->dep_map, __VA_ARGS__)
+ #else
+ #define lock_set_cmp_fn(lock, ...)    do { } while (0)
+ #endif
  enum xhlock_context_t {
        XHLOCK_HARD,
        XHLOCK_SOFT,
Simple merge
Simple merge
Simple merge
Simple merge