Skip to content

Commit b73056e

Browse files
committed
Merge tag 'urgent-rcu.2023.06.11a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu
Pull RCU fix from Paul McKenney: "This fixes a spinlock-initialization regression in SRCU that causes the SRCU notifier to fail. The fix simply adds the initialization, but introduces a #ifdef because there is no spinlock to initialize for the Tiny SRCU used in !SMP builds. Yes, it would be nice to abstract this somehow in order to hide it in SRCU, but I still don't see a good way of doing this" * tag 'urgent-rcu.2023.06.11a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: notifier: Initialize new struct srcu_usage field
2 parents f4fd69a + de29a96 commit b73056e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/linux/notifier.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,22 @@ extern void srcu_init_notifier_head(struct srcu_notifier_head *nh);
106106
#define RAW_NOTIFIER_INIT(name) { \
107107
.head = NULL }
108108

109+
#ifdef CONFIG_TREE_SRCU
109110
#define SRCU_NOTIFIER_INIT(name, pcpu) \
110111
{ \
111112
.mutex = __MUTEX_INITIALIZER(name.mutex), \
112113
.head = NULL, \
114+
.srcuu = __SRCU_USAGE_INIT(name.srcuu), \
113115
.srcu = __SRCU_STRUCT_INIT(name.srcu, name.srcuu, pcpu), \
114116
}
117+
#else
118+
#define SRCU_NOTIFIER_INIT(name, pcpu) \
119+
{ \
120+
.mutex = __MUTEX_INITIALIZER(name.mutex), \
121+
.head = NULL, \
122+
.srcu = __SRCU_STRUCT_INIT(name.srcu, name.srcuu, pcpu), \
123+
}
124+
#endif
115125

116126
#define ATOMIC_NOTIFIER_HEAD(name) \
117127
struct atomic_notifier_head name = \

0 commit comments

Comments
 (0)