* Re: [PATCH 16/17] rcu: assert static storage for RCU sync and SRCU definitions [not found] ` <20260915031334.1194975-11-ynorov@nvidia.com> @ 2026-10-07 18:41 ` Joel Fernandes 2026-10-07 18:48 ` Yury Norov 0 siblings, 1 reply; 3+ messages in thread From: Joel Fernandes @ 2026-10-07 18:41 UTC (permalink / raw) To: Yury Norov Cc: Andrew Morton, Jason A. Donenfeld, Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Matthew Wilcox, Peter Zijlstra, Ingo Molnar, Will Deacon, Boqun Feng, Waiman Long, Dennis Zhou, Tejun Heo, Christoph Lameter, Paul E. McKenney, Frederic Weisbecker, Neeraj Upadhyay, Josh Triplett, Uladzislau Rezki, Steven Rostedt, Mathieu Desnoyers, Lai Jiangshan, Zqiang, Onur Özkan, Kees Cook, Joel Granados, Anna-Maria Behnsen, Thomas Gleixner, Juri Lelli, Vincent Guittot, Dietmar Eggemann, Ben Segall, Mel Gorman, Valentin Schneider, K Prateek Nayak, Mike Rapoport, Liam R. Howlett, Lorenzo Stoakes, Vlastimil Babka, Jann Horn, Pedro Falcato, Michael S. Tsirkin, Jason Wang, Xuan Zhuo, Eugenio Pérez, Sebastian Andrzej Siewior, Clark Williams, Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt, linuxppc-dev, linux-kernel, wireguard, netdev, linux-fsdevel, linux-mm, rcu, virtualization, linux-rt-devel, llvm, Yury Norov On Mon, Sep 14, 2026 at 11:13:31PM -0400, Yury Norov wrote: > DEFINE_RCU_SYNC() contains a statically initialized wait queue. SRCU > static definitions similarly rely on persistent lockdep keys and, in > Tiny SRCU, a statically initialized work item. > > Add ASSERT_STATIC_STORAGE() to DEFINE_RCU_SYNC(), both Tree SRCU > __DEFINE_SRCU() variants and Tiny SRCU's common DEFINE_SRCU() declaration. > This covers the non-static FAST and FAST_UPDOWN wrappers too. Tiny SRCU's > explicitly static declarations already enforce the required duration. > The existing per-CPU restrictions on Tree SRCU declarations still apply. > > Assisted-by: OpenAI Codex > Signed-off-by: Yury Norov <ynorov@nvidia.com> All the changes make sense to me. I'm ok with carrying this for -rcu 7.5 unless you want to take it. Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com> thanks, Joel Fernandes > --- > include/linux/rcu_sync.h | 4 +++- > include/linux/srcutiny.h | 4 +++- > include/linux/srcutree.h | 7 +++++-- > 3 files changed, 11 insertions(+), 4 deletions(-) > > diff --git a/include/linux/rcu_sync.h b/include/linux/rcu_sync.h > index 3860dbb9107a..c10b6d30561a 100644 > --- a/include/linux/rcu_sync.h > +++ b/include/linux/rcu_sync.h > @@ -10,6 +10,7 @@ > #ifndef _LINUX_RCU_SYNC_H_ > #define _LINUX_RCU_SYNC_H_ > > +#include <linux/compiler.h> > #include <linux/wait.h> > #include <linux/rcupdate.h> > > @@ -48,6 +49,7 @@ extern void rcu_sync_dtor(struct rcu_sync *); > } > > #define DEFINE_RCU_SYNC(name) \ > - struct rcu_sync name = __RCU_SYNC_INITIALIZER(name) > + struct rcu_sync name = __RCU_SYNC_INITIALIZER(name); \ > + ASSERT_STATIC_STORAGE(name) > > #endif /* _LINUX_RCU_SYNC_H_ */ > diff --git a/include/linux/srcutiny.h b/include/linux/srcutiny.h > index fbcf13bc12d1..40b592b4e2d8 100644 > --- a/include/linux/srcutiny.h > +++ b/include/linux/srcutiny.h > @@ -11,6 +11,7 @@ > #ifndef _LINUX_SRCU_TINY_H > #define _LINUX_SRCU_TINY_H > > +#include <linux/compiler.h> > #include <linux/irq_work_types.h> > #include <linux/swait.h> > > @@ -48,7 +49,8 @@ void srcu_tiny_irq_work(struct irq_work *irq_work); > * Tree SRCU, which needs some per-CPU data. > */ > #define DEFINE_SRCU(name) \ > - struct srcu_struct name = __SRCU_STRUCT_INIT(name, name, name, name) > + struct srcu_struct name = __SRCU_STRUCT_INIT(name, name, name, name); \ > + ASSERT_STATIC_STORAGE(name) > #define DEFINE_STATIC_SRCU(name) \ > static struct srcu_struct name = __SRCU_STRUCT_INIT(name, name, name, name) > #define DEFINE_SRCU_FAST(name) DEFINE_SRCU(name) > diff --git a/include/linux/srcutree.h b/include/linux/srcutree.h > index 75e54e4f963f..8bea8044230a 100644 > --- a/include/linux/srcutree.h > +++ b/include/linux/srcutree.h > @@ -11,6 +11,7 @@ > #ifndef _LINUX_SRCU_TREE_H > #define _LINUX_SRCU_TREE_H > > +#include <linux/compiler.h> > #include <linux/rcu_node_tree.h> > #include <linux/completion.h> > > @@ -217,13 +218,15 @@ struct srcu_struct { > fast); \ > extern struct srcu_struct * const __srcu_struct_##name; \ > struct srcu_struct * const __srcu_struct_##name \ > - __section("___srcu_struct_ptrs") = &name > + __section("___srcu_struct_ptrs") = &name; \ > + ASSERT_STATIC_STORAGE(name) > #else > # define __DEFINE_SRCU(name, fast, is_static) \ > static DEFINE_PER_CPU(struct srcu_data, name##_srcu_data); \ > static struct srcu_usage name##_srcu_usage = __SRCU_USAGE_INIT(name##_srcu_usage); \ > is_static struct srcu_struct name = \ > - __SRCU_STRUCT_INIT(name, name##_srcu_usage, name##_srcu_data, fast) > + __SRCU_STRUCT_INIT(name, name##_srcu_usage, name##_srcu_data, fast); \ > + ASSERT_STATIC_STORAGE(name) > #endif > #define DEFINE_SRCU(name) __DEFINE_SRCU(name, 0, /* not static */) > #define DEFINE_STATIC_SRCU(name) __DEFINE_SRCU(name, 0, static) > -- > 2.53.0 > ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 16/17] rcu: assert static storage for RCU sync and SRCU definitions 2026-10-07 18:41 ` [PATCH 16/17] rcu: assert static storage for RCU sync and SRCU definitions Joel Fernandes @ 2026-10-07 18:48 ` Yury Norov 2026-10-07 18:58 ` Joel Fernandes 0 siblings, 1 reply; 3+ messages in thread From: Yury Norov @ 2026-10-07 18:48 UTC (permalink / raw) To: Joel Fernandes Cc: Andrew Morton, Jason A. Donenfeld, Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Matthew Wilcox, Peter Zijlstra, Ingo Molnar, Will Deacon, Boqun Feng, Waiman Long, Dennis Zhou, Tejun Heo, Christoph Lameter, Paul E. McKenney, Frederic Weisbecker, Neeraj Upadhyay, Josh Triplett, Uladzislau Rezki, Steven Rostedt, Mathieu Desnoyers, Lai Jiangshan, Zqiang, Onur Özkan, Kees Cook, Joel Granados, Anna-Maria Behnsen, Thomas Gleixner, Juri Lelli, Vincent Guittot, Dietmar Eggemann, Ben Segall, Mel Gorman, Valentin Schneider, K Prateek Nayak, Mike Rapoport, Liam R. Howlett, Lorenzo Stoakes, Vlastimil Babka, Jann Horn, Pedro Falcato, Michael S. Tsirkin, Jason Wang, Xuan Zhuo, Eugenio Pérez, Sebastian Andrzej Siewior, Clark Williams, Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt, linuxppc-dev, linux-kernel, wireguard, netdev, linux-fsdevel, linux-mm, rcu, virtualization, linux-rt-devel, llvm, Yury Norov On Wed, Oct 07, 2026 at 02:41:05PM -0400, Joel Fernandes wrote: > On Mon, Sep 14, 2026 at 11:13:31PM -0400, Yury Norov wrote: > > DEFINE_RCU_SYNC() contains a statically initialized wait queue. SRCU > > static definitions similarly rely on persistent lockdep keys and, in > > Tiny SRCU, a statically initialized work item. > > > > Add ASSERT_STATIC_STORAGE() to DEFINE_RCU_SYNC(), both Tree SRCU > > __DEFINE_SRCU() variants and Tiny SRCU's common DEFINE_SRCU() declaration. > > This covers the non-static FAST and FAST_UPDOWN wrappers too. Tiny SRCU's > > explicitly static declarations already enforce the required duration. > > The existing per-CPU restrictions on Tree SRCU declarations still apply. > > > > Assisted-by: OpenAI Codex > > Signed-off-by: Yury Norov <ynorov@nvidia.com> > > All the changes make sense to me. I'm ok with carrying this for -rcu 7.5 > unless you want to take it. > > Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com> Thanks Joel, carrying it with the RCU branch is the preferred route IMO. Thanks, Yury ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 16/17] rcu: assert static storage for RCU sync and SRCU definitions 2026-10-07 18:48 ` Yury Norov @ 2026-10-07 18:58 ` Joel Fernandes 0 siblings, 0 replies; 3+ messages in thread From: Joel Fernandes @ 2026-10-07 18:58 UTC (permalink / raw) To: Yury Norov Cc: Andrew Morton, Jason A. Donenfeld, Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Matthew Wilcox, Peter Zijlstra, Ingo Molnar, Will Deacon, Boqun Feng, Waiman Long, Dennis Zhou, Tejun Heo, Christoph Lameter, Paul E. McKenney, Frederic Weisbecker, Neeraj Upadhyay, Josh Triplett, Uladzislau Rezki, Steven Rostedt, Mathieu Desnoyers, Lai Jiangshan, Zqiang, Onur Özkan, Kees Cook, Joel Granados, Anna-Maria Behnsen, Thomas Gleixner, Juri Lelli, Vincent Guittot, Dietmar Eggemann, Ben Segall, Mel Gorman, Valentin Schneider, K Prateek Nayak, Mike Rapoport, Liam R. Howlett, Lorenzo Stoakes, Vlastimil Babka, Jann Horn, Pedro Falcato, Michael S. Tsirkin, Jason Wang, Xuan Zhuo, Eugenio Pérez, Sebastian Andrzej Siewior, Clark Williams, Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt, linuxppc-dev, linux-kernel, wireguard, netdev, linux-fsdevel, linux-mm, rcu, virtualization, linux-rt-devel, llvm, Yury Norov On 10/7/2026 2:48 PM, Yury Norov wrote: > On Wed, Oct 07, 2026 at 02:41:05PM -0400, Joel Fernandes wrote: >> On Mon, Sep 14, 2026 at 11:13:31PM -0400, Yury Norov wrote: >>> DEFINE_RCU_SYNC() contains a statically initialized wait queue. SRCU >>> static definitions similarly rely on persistent lockdep keys and, in >>> Tiny SRCU, a statically initialized work item. >>> >>> Add ASSERT_STATIC_STORAGE() to DEFINE_RCU_SYNC(), both Tree SRCU >>> __DEFINE_SRCU() variants and Tiny SRCU's common DEFINE_SRCU() declaration. >>> This covers the non-static FAST and FAST_UPDOWN wrappers too. Tiny SRCU's >>> explicitly static declarations already enforce the required duration. >>> The existing per-CPU restrictions on Tree SRCU declarations still apply. >>> >>> Assisted-by: OpenAI Codex >>> Signed-off-by: Yury Norov <ynorov@nvidia.com> >> >> All the changes make sense to me. I'm ok with carrying this for -rcu 7.5 >> unless you want to take it. >> >> Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com> > > Thanks Joel, carrying it with the RCU branch is the preferred route IMO. Ok, applying this patch for -rcu 7.5, thanks! thanks, Joel Fernandes ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-26 5:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260915030336.1192299-1-ynorov@nvidia.com>
[not found] ` <20260915031334.1194975-11-ynorov@nvidia.com>
2026-10-07 18:41 ` [PATCH 16/17] rcu: assert static storage for RCU sync and SRCU definitions Joel Fernandes
2026-10-07 18:48 ` Yury Norov
2026-10-07 18:58 ` Joel Fernandes
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox