From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D0D01B87C0 for ; Sun, 8 Feb 2026 10:02:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770544946; cv=none; b=aGpa32kPDZL/DlTLPMuS3BsZm9IGQGAEHoZm6B1OZFV1ukzP89/z2RLt6sOTnJcNIrHdckdVXE+tA6ohzyamS3OwcevaDifiGXAwAOZ1nspDCZEIP2lOa7be5Q5DM+Fzpy5Oz7fErkmlbglZPV/VS4AJlKhaiXNhwKjZK7GRHuA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770544946; c=relaxed/simple; bh=trGPLhRJE9fio8NyaskX8DHzz2Ahnsbe+yj26COMPvE=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=NGvZ8liuZdUynKQbS9NIuvxbFggqiDhLZ0ceLzb5u66ReN+lvYtH5wcOCnRh0BtBCQP8xnRKafTo3nQciN8RoAeDGPopkvEZfSOC8+i++UIgzeWFjsiyuDJE9zWZPrpHvKaJTQrKd+7c79JnFVQQU4Kibw8so2C97W0KOtzmrUw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VQTkzP3n; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VQTkzP3n" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FCB5C4CEF7; Sun, 8 Feb 2026 10:02:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770544945; bh=trGPLhRJE9fio8NyaskX8DHzz2Ahnsbe+yj26COMPvE=; h=Date:From:To:Cc:Subject:From; b=VQTkzP3ngfdmjb/bgbnIQUM2EcaSo8ZrRlIl2Y3IFCaTl+J0Vm4mEBRr3UBZz0cbU Ty4ai5ls+TPKiCDy/tBRt0kYpAefqwHRS/oqWr0D0zua6m46yPL2TXR63aaS5qw0Wc wSCbvhLntYeCjMWTpjq2i4DxLWbz/2ToQdEZap1QVgJ+CHzpcGg/nZOpuD7hLuc3nb X2xkBWh52oLnSQXjOMDmMGhmAgJvfwHKPu7qs93ygzVtxcipriR5zzELZlPn3DFbp3 UxxRH9okowfxLOibPKlEGynJvGMFt4w7Qgiq7+qD8kN3x2XkqkhTJlvxNuA16cx0x5 HOcYHOW5xkaoQ== Date: Sun, 8 Feb 2026 11:02:19 +0100 From: Ingo Molnar To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Thomas Gleixner , Will Deacon , Waiman Long , Boqun Feng , Borislav Petkov , Uros Bizjak , Sebastian Andrzej Siewior , Gary Guo , Oleg Nesterov , Marco Elver Subject: [GIT PULL] locking updates for v6.20 Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Linus, Please pull the latest locking/core Git tree from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking-core-2026-02-08 for you to fetch changes up to 7a562d5d2396c9c78fbbced7ae81bcfcfa0fde3f: [ MERGE NOTE: please note the default-enabled nature of the new locking context analysis feature, and its justification described below. If that's too aggressive, please disregard this pull request. ] Locking updates for v6.20: Lock debugging: - Implement compiler-driven static analysis locking context checking, using the upcoming Clang 22 compiler's context analysis features. (Marco Elver) We removed Sparse context analysis support, because prior to removal even a defconfig kernel produced 1,700+ context tracking Sparse warnings, the overwhelming majority of which are false positives. On an allmodconfig kernel the number of false positive context tracking Sparse warnings grows to over 5,200... On the plus side of the balance actual locking bugs found by Sparse context analysis is also rather ... sparse: I found only 3 such commits in the last 3 years. So the rate of false positives and the maintenance overhead is rather high and there appears to be no active policy in place to achieve a zero-warnings baseline to move the annotations & fixers to developers who introduce new code. Clang context analysis is more complete and more aggressive in trying to find bugs, at least in principle. Plus it has a different model to enabling it: it's enabled subsystem by subsystem, which results in zero warnings on all relevant kernel builds (as far as our testing managed to cover it). Which allowed us to enable it by default, similar to other compiler warnings, with the expectation that there are no warnings going forward. This enforces a zero-warnings baseline on clang-22+ builds. (Which are still limited in distribution, admittedly.) Hopefully the Clang approach can lead to a more maintainable zero-warnings status quo and policy, with more and more subsystems and drivers enabling the feature. Context tracking can be enabled for all kernel code via WARN_CONTEXT_ANALYSIS_ALL=y (default disabled), but this will generate a lot of false positives. ( Having said that, Sparse support could still be added back, if anyone is interested - the removal patch is still relatively straightforward to revert at this stage. ) Rust integration updates: (Alice Ryhl, Fujita Tomonori, Boqun Feng) - Add support for Atomic and replace most Rust native AtomicBool usages with Atomic - Clean up LockClassKey and improve its documentation - Add missing Send and Sync trait implementation for SetOnce - Make ARef Unpin as it is supposed to be - Add __rust_helper to a few Rust helpers as a preparation for helper LTO - Inline various lock related functions to avoid additional function calls. WW mutexes: - Extend ww_mutex tests and other test-ww_mutex updates (John Stultz) Misc fixes and cleanups: - rcu: Mark lockdep_assert_rcu_helper() __always_inline (Arnd Bergmann) - locking/local_lock: Include more missing headers (Peter Zijlstra) - seqlock: fix scoped_seqlock_read kernel-doc (Randy Dunlap) - rust: sync: Replace `kernel::c_str!` with C-Strings (Tamir Duberstein) Thanks, Ingo ------------------> Alice Ryhl (16): rust: sync: Refactor static_lock_class!() macro rust: sync: Clean up LockClassKey and its docs rust: sync: Implement Unpin for ARef rust: barrier: Add __rust_helper to helpers rust: blk: Add __rust_helper to helpers rust: completion: Add __rust_helper to helpers rust: cpu: Add __rust_helper to helpers rust: processor: Add __rust_helper to helpers rust: rcu: Add __rust_helper to helpers rust: refcount: Add __rust_helper to helpers rust: sync: Add __rust_helper to helpers rust: task: Add __rust_helper to helpers rust: time: Add __rust_helper to helpers rust: wait: Add __rust_helper to helpers rust: helpers: Move #define __rust_helper out of atomic.c rust: sync: Inline various lock related methods Arnd Bergmann (1): rcu: Mark lockdep_assert_rcu_helper() __always_inline Boqun Feng (1): arch: um/x86: Select ARCH_SUPPORTS_ATOMIC_RMW for UML_X86 FUJITA Tomonori (19): rust: sync: set_once: Implement Send and Sync rust: helpers: Add i8/i16 atomic_read_acquire/atomic_set_release helpers rust: helpers: Add i8/i16 relaxed atomic helpers rust: helpers: Add i8/i16 atomic xchg helpers rust: helpers: Add i8/i16 atomic xchg_acquire helpers rust: helpers: Add i8/i16 atomic xchg_release helpers rust: helpers: Add i8/i16 atomic xchg_relaxed helpers rust: helpers: Add i8/i16 atomic try_cmpxchg helpers rust: helpers: Add i8/i16 atomic try_cmpxchg_acquire helpers rust: helpers: Add i8/i16 atomic try_cmpxchg_release helpers rust: helpers: Add i8/i16 atomic try_cmpxchg_relaxed helpers rust: sync: atomic: Prepare AtomicOps macros for i8/i16 support rust: sync: atomic: Add i8/i16 load and store support rust: sync: atomic: Add store_release/load_acquire tests rust: sync: atomic: Add i8/i16 xchg and cmpxchg support rust: sync: atomic: Add atomic bool support via i8 representation rust: sync: atomic: Add atomic bool tests rust: list: Switch to kernel::sync atomic primitives rust_binder: Switch to kernel::sync atomic primitives John Stultz (3): test-ww_mutex: Extend ww_mutex tests to test both classes of ww_mutexes test-ww_mutex: Move work to its own UNBOUND workqueue test-ww_mutex: Allow test to be run (and re-run) from userland Marco Elver (45): compiler_types: Move lock checking attributes to compiler-context-analysis.h compiler-context-analysis: Add infrastructure for Context Analysis with Clang compiler-context-analysis: Add test stub Documentation: Add documentation for Compiler-Based Context Analysis checkpatch: Warn about context_unsafe() without comment cleanup: Basic compatibility with context analysis lockdep: Annotate lockdep assertions for context analysis locking/rwlock, spinlock: Support Clang's context analysis compiler-context-analysis: Change __cond_acquires to take return value locking/mutex: Support Clang's context analysis locking/seqlock: Support Clang's context analysis bit_spinlock: Include missing bit_spinlock: Support Clang's context analysis rcu: Support Clang's context analysis srcu: Support Clang's context analysis kref: Add context-analysis annotations locking/rwsem: Support Clang's context analysis locking/local_lock: Include missing headers locking/local_lock: Support Clang's context analysis locking/ww_mutex: Support Clang's context analysis debugfs: Make debugfs_cancellation a context lock struct um: Fix incorrect __acquires/__releases annotations compiler-context-analysis: Remove Sparse support compiler-context-analysis: Remove __cond_lock() function-like helper compiler-context-analysis: Introduce header suppressions compiler: Let data_race() imply disabled context analysis MAINTAINERS: Add entry for Context Analysis kfence: Enable context analysis kcov: Enable context analysis kcsan: Enable context analysis stackdepot: Enable context analysis rhashtable: Enable context analysis printk: Move locking annotation to printk.c security/tomoyo: Enable context analysis crypto: Enable context analysis sched: Enable context analysis for core.c and fair.c compiler-context-analysys: Fix CONFIG_MODVERSION tools: Update context analysis macros in compiler_types.h cleanup: Make __DEFINE_LOCK_GUARD handle commas in initializers compiler-context-analysis: Introduce scoped init guards kcov: Use scoped init guard crypto: Use scoped init guard tomoyo: Use scoped init guard compiler-context-analysis: Remove __assume_ctx_lock from initializers locking/rwlock: Fix write_trylock_irqsave() with CONFIG_INLINE_WRITE_TRYLOCK Peter Zijlstra (2): tags: Add regex for context_lock_struct locking/local_lock: Include more missing headers Randy Dunlap (1): seqlock: fix scoped_seqlock_read kernel-doc Tamir Duberstein (1): rust: sync: Replace `kernel::c_str!` with C-Strings oldzhu (1): scripts/atomic: Fix kerneldoc spelling in try_cmpxchg() Documentation/dev-tools/context-analysis.rst | 169 ++++++ Documentation/dev-tools/index.rst | 1 + Documentation/dev-tools/sparse.rst | 19 - Documentation/mm/process_addrs.rst | 6 +- MAINTAINERS | 11 + Makefile | 1 + arch/um/include/shared/skas/mm_id.h | 5 +- arch/um/kernel/skas/mmu.c | 13 +- arch/x86/um/Kconfig | 1 + crypto/Makefile | 2 + crypto/acompress.c | 6 +- crypto/algapi.c | 2 + crypto/api.c | 1 + crypto/crypto_engine.c | 2 +- crypto/drbg.c | 7 +- crypto/internal.h | 2 +- crypto/proc.c | 3 + crypto/scompress.c | 24 +- drivers/android/binder/rust_binder_main.rs | 20 +- drivers/android/binder/stats.rs | 8 +- drivers/android/binder/thread.rs | 24 +- drivers/android/binder/transaction.rs | 16 +- drivers/net/wireless/intel/iwlwifi/iwl-trans.c | 4 +- drivers/net/wireless/intel/iwlwifi/iwl-trans.h | 6 +- .../wireless/intel/iwlwifi/pcie/gen1_2/internal.h | 5 +- .../net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c | 4 +- fs/dlm/lock.c | 2 +- include/crypto/internal/acompress.h | 7 +- include/crypto/internal/engine.h | 2 +- include/linux/atomic/atomic-arch-fallback.h | 18 +- include/linux/atomic/atomic-instrumented.h | 26 +- include/linux/atomic/atomic-long.h | 10 +- include/linux/bit_spinlock.h | 24 +- include/linux/cleanup.h | 58 +- include/linux/compiler-context-analysis.h | 436 +++++++++++++++ include/linux/compiler.h | 2 + include/linux/compiler_types.h | 18 +- include/linux/console.h | 4 +- include/linux/debugfs.h | 12 +- include/linux/kref.h | 2 + include/linux/list_bl.h | 2 + include/linux/local_lock.h | 59 +- include/linux/local_lock_internal.h | 72 ++- include/linux/lockdep.h | 12 +- include/linux/lockref.h | 4 +- include/linux/mm.h | 33 +- include/linux/mutex.h | 40 +- include/linux/mutex_types.h | 4 +- include/linux/rcupdate.h | 90 ++-- include/linux/refcount.h | 6 +- include/linux/rhashtable.h | 16 +- include/linux/rwlock.h | 19 +- include/linux/rwlock_api_smp.h | 43 +- include/linux/rwlock_rt.h | 43 +- include/linux/rwlock_types.h | 10 +- include/linux/rwsem.h | 78 ++- include/linux/sched.h | 6 +- include/linux/sched/signal.h | 16 +- include/linux/sched/task.h | 6 +- include/linux/sched/wake_q.h | 3 + include/linux/seqlock.h | 57 +- include/linux/seqlock_types.h | 5 +- include/linux/spinlock.h | 119 ++-- include/linux/spinlock_api_smp.h | 34 +- include/linux/spinlock_api_up.h | 112 ++-- include/linux/spinlock_rt.h | 36 +- include/linux/spinlock_types.h | 10 +- include/linux/spinlock_types_raw.h | 5 +- include/linux/srcu.h | 73 ++- include/linux/srcutiny.h | 6 + include/linux/srcutree.h | 10 +- include/linux/ww_mutex.h | 21 +- kernel/Makefile | 2 + kernel/kcov.c | 36 +- kernel/kcsan/Makefile | 2 + kernel/kcsan/report.c | 11 +- kernel/locking/test-ww_mutex.c | 165 ++++-- kernel/printk/printk.c | 2 + kernel/sched/Makefile | 3 + kernel/sched/core.c | 89 ++- kernel/sched/fair.c | 7 +- kernel/sched/sched.h | 126 +++-- kernel/signal.c | 4 +- kernel/time/posix-timers.c | 13 +- lib/Kconfig.debug | 44 ++ lib/Makefile | 6 + lib/dec_and_lock.c | 8 +- lib/lockref.c | 1 - lib/rhashtable.c | 5 +- lib/stackdepot.c | 20 +- lib/test_context-analysis.c | 598 +++++++++++++++++++++ mm/kfence/Makefile | 2 + mm/kfence/core.c | 20 +- mm/kfence/kfence.h | 14 +- mm/kfence/report.c | 4 +- mm/memory.c | 4 +- mm/pgtable-generic.c | 19 +- net/ipv4/tcp_sigpool.c | 2 +- rust/helpers/atomic.c | 7 +- rust/helpers/atomic_ext.c | 139 +++++ rust/helpers/barrier.c | 6 +- rust/helpers/blk.c | 4 +- rust/helpers/completion.c | 2 +- rust/helpers/cpu.c | 2 +- rust/helpers/helpers.c | 3 + rust/helpers/mutex.c | 13 +- rust/helpers/processor.c | 2 +- rust/helpers/rcu.c | 4 +- rust/helpers/refcount.c | 10 +- rust/helpers/signal.c | 2 +- rust/helpers/spinlock.c | 13 +- rust/helpers/sync.c | 4 +- rust/helpers/task.c | 24 +- rust/helpers/time.c | 14 +- rust/helpers/wait.c | 2 +- rust/kernel/list/arc.rs | 14 +- rust/kernel/sync.rs | 73 ++- rust/kernel/sync/aref.rs | 3 + rust/kernel/sync/atomic/internal.rs | 114 +++- rust/kernel/sync/atomic/predefine.rs | 55 +- rust/kernel/sync/lock.rs | 7 + rust/kernel/sync/lock/global.rs | 2 + rust/kernel/sync/lock/mutex.rs | 5 + rust/kernel/sync/lock/spinlock.rs | 5 + rust/kernel/sync/set_once.rs | 8 + scripts/Makefile.context-analysis | 11 + scripts/Makefile.lib | 10 + scripts/atomic/gen-rust-atomic-helpers.sh | 5 - scripts/atomic/kerneldoc/try_cmpxchg | 2 +- scripts/checkpatch.pl | 7 + scripts/context-analysis-suppression.txt | 33 ++ scripts/tags.sh | 1 + security/tomoyo/Makefile | 2 + security/tomoyo/common.c | 54 +- security/tomoyo/common.h | 77 +-- security/tomoyo/domain.c | 1 + security/tomoyo/environ.c | 1 + security/tomoyo/file.c | 5 + security/tomoyo/gc.c | 28 +- security/tomoyo/mount.c | 2 + security/tomoyo/network.c | 3 + tools/include/linux/compiler-context-analysis.h | 42 ++ tools/include/linux/compiler_types.h | 18 +- tools/testing/shared/linux/kernel.h | 4 - 144 files changed, 3222 insertions(+), 861 deletions(-) create mode 100644 Documentation/dev-tools/context-analysis.rst create mode 100644 include/linux/compiler-context-analysis.h create mode 100644 lib/test_context-analysis.c create mode 100644 rust/helpers/atomic_ext.c create mode 100644 scripts/Makefile.context-analysis create mode 100644 scripts/context-analysis-suppression.txt create mode 100644 tools/include/linux/compiler-context-analysis.h