Commit 6f4cec2
rcu: Eliminate lockless accesses to rcu_sync->gp_count
The rcu_sync structure's ->gp_count field is always accessed under the
protection of that same structure's ->rss_lock field, with the exception
of a pair of WARN_ON_ONCE() calls just prior to acquiring that lock in
functions rcu_sync_exit() and rcu_sync_dtor(). These lockless accesses
are unnecessary and impair KCSAN's ability to catch bugs that might be
inserted via other lockless accesses.
This commit therefore moves those WARN_ON_ONCE() calls under the lock.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>1 parent 7f09e70 commit 6f4cec2
1 file changed
+4
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | | - | |
156 | 154 | | |
157 | | - | |
158 | 155 | | |
159 | 156 | | |
160 | | - | |
161 | | - | |
162 | | - | |
| 157 | + | |
| 158 | + | |
163 | 159 | | |
164 | 160 | | |
165 | 161 | | |
| |||
178 | 174 | | |
179 | 175 | | |
180 | 176 | | |
181 | | - | |
182 | 177 | | |
183 | 178 | | |
184 | 179 | | |
| 180 | + | |
185 | 181 | | |
186 | 182 | | |
187 | 183 | | |
| |||
0 commit comments