Skip to content

Treewide: enforce static storage for object initializers

Yury Norov linux-fsdevel linux-mm linux-rt-devel linuxppc-dev lkml llvm netdev rcu virtualization wireguard 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest17 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17locking/mutex: assert static storage for DEFINE_MUTEX()drivers/net/wireguard/selftest/allowedips.c include/linux/mutex.h tools/testing/memblock/linux/mutex.h +1 more+17 -72 replies
2/17locking/rtmutex: assert static storage for DEFINE_RT_MUTEX()include/linux/rtmutex.h+2 -10 replies
3/17locking/rwsem: assert static storage for semaphore definitionsinclude/linux/percpu-rwsem.h include/linux/rwsem.h+8 -30 replies
4/17locking/semaphore: assert static storage for DEFINE_SEMAPHORE()include/linux/semaphore.h+3 -10 replies
5/17locking/seqlock: assert static storage for DEFINE_SEQLOCK()include/linux/seqlock.h+2 -10 replies
6/17sched: assert static storage for wait queue and completion declarationsdrivers/macintosh/ams/ams-pmu.c include/linux/completion.h include/linux/swait.h +1 more+18 -90 replies
7/17xarray: assert static storage for DEFINE_XARRAY_FLAGS()include/linux/xarray.h tools/testing/radix-tree/iteration_check_2.c+5 -20 replies
8/17idr: enforce the static-storage contract of DEFINE_IDR()include/linux/idr.h tools/testing/radix-tree/idr-test.c+23 -100 replies
9/17radix-tree: require static storage for RADIX_TREE()include/linux/radix-tree.h tools/testing/radix-tree/benchmark.c tools/testing/radix-tree/main.c +2 more+42 -140 replies
10/17klist: assert static storage for DEFINE_KLIST()include/linux/klist.h+3 -10 replies
11/17workqueue: assert static storage for work declarationsinclude/linux/workqueue.h+7 -30 replies
12/17timers: assert static storage for DEFINE_TIMER()include/linux/timer.h+3 -11 reply
13/17kthread: assert static storage for delayed work declarationsinclude/linux/kthread.h+3 -10 replies
14/17ratelimit: assert static storage for DEFINE_RATELIMIT_STATE()include/linux/ratelimit_types.h tools/virtio/linux/compiler.h tools/virtio/linux/ratelimit.h+17 -20 replies
15/17notifier: assert static storage for locking notifier headsinclude/linux/notifier.h+9 -40 replies
16/17rcu: assert static storage for RCU sync and SRCU definitionsinclude/linux/rcu_sync.h include/linux/srcutiny.h include/linux/srcutree.h+11 -43 replies
17/17sysctl: assert static storage for DEFINE_CTL_TABLE_POLL()include/linux/sysctl.h+3 -11 reply

Reviews trailers per patch

3 of 17 patches have a Reviewed-by or Acked-by.

PatchJoel GranadosThomas GleixnerJoel Fernandes
1/17
2/17
3/17
4/17
5/17
6/17
7/17
8/17
9/17
10/17
11/17
12/17R-b
13/17
14/17
15/17
16/17R-b
17/17R-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 3 reviewers.

Read the v1 thread

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

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.

--

[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(-)
Signature · 1 line
2.53.0