29 #include <linux/kernel.h>
30 #include <linux/export.h>
32 #include <linux/sched.h>
33 #include <linux/types.h>
35 #include <linux/time.h>
37 #include <linux/prefetch.h>
39 #ifdef CONFIG_RCU_TRACE
48 static void __rcu_process_callbacks(
struct rcu_ctrlblk *rcp);
59 static void rcu_idle_enter_common(
long long newval)
63 rcu_dynticks_nesting, newval));
64 rcu_dynticks_nesting = newval;
72 rcu_dynticks_nesting, newval));
74 WARN_ONCE(1,
"Current pid: %d comm: %s / Idle pid: %d comm: %s",
80 rcu_dynticks_nesting = newval;
94 if ((rcu_dynticks_nesting & DYNTICK_TASK_NEST_MASK) ==
99 rcu_idle_enter_common(newval);
113 newval = rcu_dynticks_nesting - 1;
115 rcu_idle_enter_common(newval);
121 static void rcu_idle_exit_common(
long long oldval)
125 oldval, rcu_dynticks_nesting));
133 oldval, rcu_dynticks_nesting));
135 WARN_ONCE(1,
"Current pid: %d comm: %s / Idle pid: %d comm: %s",
150 oldval = rcu_dynticks_nesting;
156 rcu_idle_exit_common(oldval);
170 oldval = rcu_dynticks_nesting;
171 rcu_dynticks_nesting++;
173 rcu_idle_exit_common(oldval);
178 #ifdef CONFIG_DEBUG_LOCK_ALLOC
185 return !rcu_dynticks_nesting;
198 return rcu_dynticks_nesting <= 0;
227 if (rcu_qsctr_help(&rcu_sched_ctrlblk) +
228 rcu_qsctr_help(&rcu_bh_ctrlblk))
241 if (rcu_qsctr_help(&rcu_bh_ctrlblk))
258 rcu_preempt_check_callbacks();
265 static void __rcu_process_callbacks(
struct rcu_ctrlblk *rcp)
279 rcu_is_callbacks_kthread()));
291 rcu_preempt_remove_callbacks(rcp);
300 debug_rcu_head_unqueue(list);
302 __rcu_reclaim(rn, list);
307 RCU_TRACE(rcu_trace_sub_qlen(rcp, cb_count));
310 rcu_is_callbacks_kthread()));
315 __rcu_process_callbacks(&rcu_sched_ctrlblk);
316 __rcu_process_callbacks(&rcu_bh_ctrlblk);
317 rcu_preempt_process_callbacks();
338 "Illegal synchronize_sched() in RCU read-side critical section");
346 static void __call_rcu(
struct rcu_head *head,
352 debug_rcu_head_queue(head);
370 __call_rcu(head,
func, &rcu_sched_ctrlblk);
380 __call_rcu(head,
func, &rcu_bh_ctrlblk);