Pull locking updates from Info Molnar: "Futex improvements: - Add the 'futex2' syscall ABI, which is an attempt to get away from the multiplex syscall and adds a little room for extentions, while lifting some limitations. - Fix futex PI recursive rt_mutex waiter state bug - Fix inter-process shared futexes on no-MMU systems - Use folios instead of pages Micro-optimizations of locking primitives: - Improve arch_spin_value_unlocked() on asm-generic ticket spinlock architectures, to improve lockref code generation - Improve the x86-32 lockref_get_not_zero() main loop by adding build-time CMPXCHG8B support detection for the relevant lockref code, and by better interfacing the CMPXCHG8B assembly code with the compiler - Introduce arch_sync_try_cmpxchg() on x86 to improve sync_try_cmpxchg() code generation. Convert some sync_cmpxchg() users to sync_try_cmpxchg(). - Micro-optimize rcuref_put_slowpath() Locking debuggability improvements: - Improve CONFIG_DEBUG_RT_MUTEXES=y to have a fast-path as well - Enforce atomicity of sched_submit_work(), which is de-facto atomic but was un-enforced previously. - Extend <linux/cleanup.h>'s no_free_ptr() with __must_check semantics - Fix ww_mutex self-tests - Clean up const-propagation in <linux/seqlock.h> and simplify the API-instantiation macros a bit RT locking improvements: - Provide the rt_mutex_*_schedule() primitives/helpers and use them in the rtmutex code to avoid recursion vs. rtlock on the PI state. - Add nested blocking lockdep asserts to rt_mutex_lock(), rtlock_lock() and rwbase_read_lock() .. plus misc fixes & cleanups" * tag 'locking-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (39 commits) futex: Don't include process MM in futex key on no-MMU locking/seqlock: Fix grammar in comment alpha: Fix up new futex syscall numbers locking/seqlock: Propagate 'const' pointers within read-only methods, remove forced type casts locking/lockdep: Fix string sizing bug that triggers a format-truncation compiler-warning locking/seqlock: Change __seqprop() to return the function pointer locking/seqlock: Simplify SEQCOUNT_LOCKNAME() locking/atomics: Use atomic_try_cmpxchg_release() to micro-optimize rcuref_put_slowpath() locking/atomic, xen: Use sync_try_cmpxchg() instead of sync_cmpxchg() locking/atomic/x86: Introduce arch_sync_try_cmpxchg() locking/atomic: Add generic support for sync_try_cmpxchg() and its fallback locking/seqlock: Fix typo in comment futex/requeue: Remove unnecessary ‘NULL’ initialization from futex_proxy_trylock_atomic() locking/local, arch: Rewrite local_add_unless() as a static inline function locking/debug: Fix debugfs API return value checks to use IS_ERR() locking/ww_mutex/test: Make sure we bail out instead of livelock locking/ww_mutex/test: Fix potential workqueue corruption locking/ww_mutex/test: Use prng instead of rng to avoid hangs at bootup futex: Add sys_futex_requeue() futex: Add flags2 argument to futex_requeue() ...
Showing the changes to include/uapi (2 of 56 files). Show all
Unified · Split
| @@ -822,9 +822,15 @@ __SYSCALL(__NR_cachestat, sys_cachestat) · 821 unmodified lines | ||
| 822 | 822 | |
| 823 | 823 | #define __NR_fchmodat2 452 |
| 824 | 824 | __SYSCALL(__NR_fchmodat2, sys_fchmodat2) |
| 825 | +#define __NR_futex_wake 454 | |
| 826 | +__SYSCALL(__NR_futex_wake, sys_futex_wake) | |
| 827 | +#define __NR_futex_wait 455 | |
| 828 | +__SYSCALL(__NR_futex_wait, sys_futex_wait) | |
| 829 | +#define __NR_futex_requeue 456 | |
| 830 | +__SYSCALL(__NR_futex_requeue, sys_futex_requeue) | |
| 825 | 831 | |
| 826 | 832 | #undef __NR_syscalls |
| 827 | −#define __NR_syscalls 453 | |
| 833 | +#define __NR_syscalls 457 | |
| 828 | 834 | |
| 829 | 835 | /* |
| 830 | 836 | * 32 bit systems traditionally used different |
| @@ -44,10 +44,35 @@ · 43 unmodified lines | ||
| 44 | 44 | FUTEX_PRIVATE_FLAG) |
| 45 | 45 | |
| 46 | 46 | /* |
| 47 | − * Flags to specify the bit length of the futex word for futex2 syscalls. | |
| 48 | − * Currently, only 32 is supported. | |
| 47 | + * Flags for futex2 syscalls. | |
| 48 | + * | |
| 49 | + * NOTE: these are not pure flags, they can also be seen as: | |
| 50 | + * | |
| 51 | + * union { | |
| 52 | + * u32 flags; | |
| 53 | + * struct { | |
| 54 | + * u32 size : 2, | |
| 55 | + * numa : 1, | |
| 56 | + * : 4, | |
| 57 | + * private : 1; | |
| 58 | + * }; | |
| 59 | + * }; | |
| 49 | 60 | */ |
| 50 | −#define FUTEX_32 2 | |
| 61 | +#define FUTEX2_SIZE_U8 0x00 | |
| 62 | +#define FUTEX2_SIZE_U16 0x01 | |
| 63 | +#define FUTEX2_SIZE_U32 0x02 | |
| 64 | +#define FUTEX2_SIZE_U64 0x03 | |
| 65 | +#define FUTEX2_NUMA 0x04 | |
| 66 | + /* 0x08 */ | |
| 67 | + /* 0x10 */ | |
| 68 | + /* 0x20 */ | |
| 69 | + /* 0x40 */ | |
| 70 | +#define FUTEX2_PRIVATE FUTEX_PRIVATE_FLAG | |
| 71 | + | |
| 72 | +#define FUTEX2_SIZE_MASK 0x03 | |
| 73 | + | |
| 74 | +/* do not use */ | |
| 75 | +#define FUTEX_32 FUTEX2_SIZE_U32 /* historical accident :-( */ | |
| 51 | 76 | |
| 52 | 77 | /* |
| 53 | 78 | * Max numbers of elements in a futex_waitv array |