History

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

Linus Torvalds committed 3 years ago

Commit b73056e2 parents f4fd69a de29a961 file · +10 −0Browse files

Showing the changes to include (1 of 1 file). Show all

Unified · Split

include/linux/notifier.h+10−0
@@ -106,12 +106,22 @@ extern void srcu_init_notifier_head(struct srcu_notifier_head *nh); · 105 unmodified lines
106#define RAW_NOTIFIER_INIT(name) { \106#define RAW_NOTIFIER_INIT(name) { \
107 .head = NULL }107 .head = NULL }
108 108
109#ifdef CONFIG_TREE_SRCU
109#define SRCU_NOTIFIER_INIT(name, pcpu) \110#define SRCU_NOTIFIER_INIT(name, pcpu) \
110 { \111 { \
111 .mutex = __MUTEX_INITIALIZER(name.mutex), \112 .mutex = __MUTEX_INITIALIZER(name.mutex), \
112 .head = NULL, \113 .head = NULL, \
114 .srcuu = __SRCU_USAGE_INIT(name.srcuu), \
113 .srcu = __SRCU_STRUCT_INIT(name.srcu, name.srcuu, pcpu), \115 .srcu = __SRCU_STRUCT_INIT(name.srcu, name.srcuu, pcpu), \
114 }116 }
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
115 125
116#define ATOMIC_NOTIFIER_HEAD(name) \126#define ATOMIC_NOTIFIER_HEAD(name) \
117 struct atomic_notifier_head name = \127 struct atomic_notifier_head name = \