hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/include/linux/rcupdate.h
....@@ -83,7 +83,7 @@
8383
8484 /* Internal to kernel */
8585 void rcu_init(void);
86
-extern int rcu_scheduler_active __read_mostly;
86
+extern int rcu_scheduler_active;
8787 void rcu_sched_clock_irq(int user);
8888 void rcu_report_dead(unsigned int cpu);
8989 void rcutree_migrate_callbacks(int cpu);
....@@ -189,6 +189,7 @@
189189
190190 #define rcu_note_voluntary_context_switch(t) rcu_tasks_qs(t, false)
191191 void exit_tasks_rcu_start(void);
192
+void exit_tasks_rcu_stop(void);
192193 void exit_tasks_rcu_finish(void);
193194 #else /* #ifdef CONFIG_TASKS_RCU_GENERIC */
194195 #define rcu_tasks_qs(t, preempt) do { } while (0)
....@@ -196,6 +197,7 @@
196197 #define call_rcu_tasks call_rcu
197198 #define synchronize_rcu_tasks synchronize_rcu
198199 static inline void exit_tasks_rcu_start(void) { }
200
+static inline void exit_tasks_rcu_stop(void) { }
199201 static inline void exit_tasks_rcu_finish(void) { }
200202 #endif /* #else #ifdef CONFIG_TASKS_RCU_GENERIC */
201203
....@@ -306,11 +308,18 @@
306308 * RCU_LOCKDEP_WARN - emit lockdep splat if specified condition is met
307309 * @c: condition to check
308310 * @s: informative message
311
+ *
312
+ * This checks debug_lockdep_rcu_enabled() before checking (c) to
313
+ * prevent early boot splats due to lockdep not yet being initialized,
314
+ * and rechecks it after checking (c) to prevent false-positive splats
315
+ * due to races with lockdep being disabled. See commit 3066820034b5dd
316
+ * ("rcu: Reject RCU_LOCKDEP_WARN() false positives") for more detail.
309317 */
310318 #define RCU_LOCKDEP_WARN(c, s) \
311319 do { \
312320 static bool __section(".data.unlikely") __warned; \
313
- if ((c) && debug_lockdep_rcu_enabled() && !__warned) { \
321
+ if (debug_lockdep_rcu_enabled() && (c) && \
322
+ debug_lockdep_rcu_enabled() && !__warned) { \
314323 __warned = true; \
315324 lockdep_rcu_suspicious(__FILE__, __LINE__, s); \
316325 } \