.. | .. |
---|
54 | 54 | * types of kernel builds, the rcu_read_lock() nesting depth is unknowable. |
---|
55 | 55 | */ |
---|
56 | 56 | #define rcu_preempt_depth() (current->rcu_read_lock_nesting) |
---|
57 | | -#ifndef CONFIG_PREEMPT_RT |
---|
58 | | -#define sched_rcu_preempt_depth() rcu_preempt_depth() |
---|
59 | | -#else |
---|
60 | | -static inline int sched_rcu_preempt_depth(void) { return 0; } |
---|
61 | | -#endif |
---|
62 | 57 | |
---|
63 | 58 | #else /* #ifdef CONFIG_PREEMPT_RCU */ |
---|
64 | 59 | |
---|
.. | .. |
---|
84 | 79 | return 0; |
---|
85 | 80 | } |
---|
86 | 81 | |
---|
87 | | -#define sched_rcu_preempt_depth() rcu_preempt_depth() |
---|
88 | | - |
---|
89 | 82 | #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ |
---|
90 | 83 | |
---|
91 | 84 | /* Internal to kernel */ |
---|
92 | 85 | void rcu_init(void); |
---|
93 | | -extern int rcu_scheduler_active __read_mostly; |
---|
| 86 | +extern int rcu_scheduler_active; |
---|
94 | 87 | void rcu_sched_clock_irq(int user); |
---|
95 | 88 | void rcu_report_dead(unsigned int cpu); |
---|
96 | 89 | void rcutree_migrate_callbacks(int cpu); |
---|
.. | .. |
---|
196 | 189 | |
---|
197 | 190 | #define rcu_note_voluntary_context_switch(t) rcu_tasks_qs(t, false) |
---|
198 | 191 | void exit_tasks_rcu_start(void); |
---|
| 192 | +void exit_tasks_rcu_stop(void); |
---|
199 | 193 | void exit_tasks_rcu_finish(void); |
---|
200 | 194 | #else /* #ifdef CONFIG_TASKS_RCU_GENERIC */ |
---|
201 | 195 | #define rcu_tasks_qs(t, preempt) do { } while (0) |
---|
.. | .. |
---|
203 | 197 | #define call_rcu_tasks call_rcu |
---|
204 | 198 | #define synchronize_rcu_tasks synchronize_rcu |
---|
205 | 199 | static inline void exit_tasks_rcu_start(void) { } |
---|
| 200 | +static inline void exit_tasks_rcu_stop(void) { } |
---|
206 | 201 | static inline void exit_tasks_rcu_finish(void) { } |
---|
207 | 202 | #endif /* #else #ifdef CONFIG_TASKS_RCU_GENERIC */ |
---|
208 | 203 | |
---|
.. | .. |
---|
313 | 308 | * RCU_LOCKDEP_WARN - emit lockdep splat if specified condition is met |
---|
314 | 309 | * @c: condition to check |
---|
315 | 310 | * @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. |
---|
316 | 317 | */ |
---|
317 | 318 | #define RCU_LOCKDEP_WARN(c, s) \ |
---|
318 | 319 | do { \ |
---|
319 | 320 | static bool __section(".data.unlikely") __warned; \ |
---|
320 | | - if ((c) && debug_lockdep_rcu_enabled() && !__warned) { \ |
---|
| 321 | + if (debug_lockdep_rcu_enabled() && (c) && \ |
---|
| 322 | + debug_lockdep_rcu_enabled() && !__warned) { \ |
---|
321 | 323 | __warned = true; \ |
---|
322 | 324 | lockdep_rcu_suspicious(__FILE__, __LINE__, s); \ |
---|
323 | 325 | } \ |
---|
.. | .. |
---|
336 | 338 | #define rcu_sleep_check() \ |
---|
337 | 339 | do { \ |
---|
338 | 340 | rcu_preempt_sleep_check(); \ |
---|
339 | | - if (!IS_ENABLED(CONFIG_PREEMPT_RT)) \ |
---|
340 | | - RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map), \ |
---|
| 341 | + RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map), \ |
---|
341 | 342 | "Illegal context switch in RCU-bh read-side critical section"); \ |
---|
342 | 343 | RCU_LOCKDEP_WARN(lock_is_held(&rcu_sched_lock_map), \ |
---|
343 | 344 | "Illegal context switch in RCU-sched read-side critical section"); \ |
---|