Re: [PATCH 00/17] Treewide: enforce static storage for object initializers

From
Yury Norov <hidden>
Date
2026-11-18 21:40:20
Also in
linux-fsdevel, linux-mm, linux-rt-devel, linuxppc-dev, lkml, llvm, rcu, virtualization
Reply to
Yury Norov, 2026-09-15
So, any progress on this? Should I rebase and resend, or we can merge
it as is? Andrew?

Thanks,
Yury

On Mon, Sep 14, 2026 at 11:03:18PM -0400, Yury Norov wrote:
On top of [1].

Declaration macros that statically initialize embedded locks require static
storage when lockdep is enabled. Automatic objects must use runtime
initialization so lockdep receives a persistent class key.

For automatic local objects, lockdep cannot use the lock address as a persistent
class key and reports "INFO: trying to register non-static key" before disabling
itself.

Series [1] introduces an ASSERT_STATIC_STORAGE() macro to enforce static
duration of an object, and applies it for DEFINE_IDA() and DEFINE_MTREE().

This series applies the same mechanism for the other structures of that
sort found by Codex.

Link: https://lore.kernel.org/all/20260911221444.1523311-1-ynorov@nvidia.com/ (local) [1]

--

[1] also describes the preferred route(s) for the material. According to
Andrew's (and mine) preferences, sending everything together in the hope
that the relevant maintainers would ack the corresponding patches or
simply take them in their trees.

Yury Norov (17):
  locking/mutex: assert static storage for DEFINE_MUTEX()
  locking/rtmutex: assert static storage for DEFINE_RT_MUTEX()
  locking/rwsem: assert static storage for semaphore definitions
  locking/semaphore: assert static storage for DEFINE_SEMAPHORE()
  locking/seqlock: assert static storage for DEFINE_SEQLOCK()
  sched: assert static storage for wait queue and completion
    declarations
  xarray: assert static storage for DEFINE_XARRAY_FLAGS()
  idr: enforce the static-storage contract of DEFINE_IDR()
  radix-tree: require static storage for RADIX_TREE()
  klist: assert static storage for DEFINE_KLIST()
  workqueue: assert static storage for work declarations
  timers: assert static storage for DEFINE_TIMER()
  kthread: assert static storage for delayed work declarations
  ratelimit: assert static storage for DEFINE_RATELIMIT_STATE()
  notifier: assert static storage for locking notifier heads
  rcu: assert static storage for RCU sync and SRCU definitions
  sysctl: assert static storage for DEFINE_CTL_TABLE_POLL()

 drivers/macintosh/ams/ams-pmu.c              |  4 +--
 drivers/net/wireguard/selftest/allowedips.c  |  4 +--
 include/linux/completion.h                   | 10 +++++--
 include/linux/idr.h                          |  4 ++-
 include/linux/klist.h                        |  4 ++-
 include/linux/kthread.h                      |  4 ++-
 include/linux/mutex.h                        |  7 +++--
 include/linux/notifier.h                     | 13 ++++++---
 include/linux/percpu-rwsem.h                 |  4 ++-
 include/linux/radix-tree.h                   |  4 ++-
 include/linux/ratelimit_types.h              |  4 ++-
 include/linux/rcu_sync.h                     |  4 ++-
 include/linux/rtmutex.h                      |  3 +-
 include/linux/rwsem.h                        |  7 +++--
 include/linux/semaphore.h                    |  4 ++-
 include/linux/seqlock.h                      |  3 +-
 include/linux/srcutiny.h                     |  4 ++-
 include/linux/srcutree.h                     |  7 +++--
 include/linux/swait.h                        |  6 ++--
 include/linux/sysctl.h                       |  4 ++-
 include/linux/timer.h                        |  4 ++-
 include/linux/wait.h                         |  7 +++--
 include/linux/workqueue.h                    | 10 +++++--
 include/linux/xarray.h                       |  3 +-
 tools/testing/memblock/linux/mutex.h         |  8 ++++--
 tools/testing/radix-tree/benchmark.c         |  4 ++-
 tools/testing/radix-tree/idr-test.c          | 29 ++++++++++++++------
 tools/testing/radix-tree/iteration_check_2.c |  4 ++-
 tools/testing/radix-tree/main.c              | 16 ++++++++---
 tools/testing/radix-tree/regression3.c       |  4 ++-
 tools/testing/radix-tree/tag_check.c         | 28 ++++++++++++++-----
 tools/testing/vma/include/dup.h              |  5 +++-
 tools/virtio/linux/compiler.h                |  9 ++++++
 tools/virtio/linux/ratelimit.h               |  6 +++-
 34 files changed, 176 insertions(+), 65 deletions(-)

-- 
2.53.0
Thread (29 messages) 29 messages, 7 authors, last reply 3d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help