Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+10
+10
include/linux/notifier.h
··· 106 106 #define RAW_NOTIFIER_INIT(name) { \ 107 107 .head = NULL } 108 108 109 + #ifdef CONFIG_TREE_SRCU 110 + #define SRCU_NOTIFIER_INIT(name, pcpu) \ 111 + { \ 112 + .mutex = __MUTEX_INITIALIZER(name.mutex), \ 113 + .head = NULL, \ 114 + .srcuu = __SRCU_USAGE_INIT(name.srcuu), \ 115 + .srcu = __SRCU_STRUCT_INIT(name.srcu, name.srcuu, pcpu), \ 116 + } 117 + #else 109 118 #define SRCU_NOTIFIER_INIT(name, pcpu) \ 110 119 { \ 111 120 .mutex = __MUTEX_INITIALIZER(name.mutex), \ 112 121 .head = NULL, \ 113 122 .srcu = __SRCU_STRUCT_INIT(name.srcu, name.srcuu, pcpu), \ 114 123 } 124 + #endif 115 125 116 126 #define ATOMIC_NOTIFIER_HEAD(name) \ 117 127 struct atomic_notifier_head name = \