Merge branch 'x86-paravirt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-block.git] / kernel / rcu / tree.h
CommitLineData
9f77da9f
PM
1/*
2 * Read-Copy Update mechanism for mutual exclusion (tree-based version)
3 * Internal non-public definitions.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
87de1cfd
PM
16 * along with this program; if not, you can access it online at
17 * http://www.gnu.org/licenses/gpl-2.0.html.
9f77da9f
PM
18 *
19 * Copyright IBM Corporation, 2008
20 *
21 * Author: Ingo Molnar <mingo@elte.hu>
22 * Paul E. McKenney <paulmck@linux.vnet.ibm.com>
23 */
24
25#include <linux/cache.h>
26#include <linux/spinlock.h>
037741a6 27#include <linux/rtmutex.h>
9f77da9f
PM
28#include <linux/threads.h>
29#include <linux/cpumask.h>
30#include <linux/seqlock.h>
abedf8e2 31#include <linux/swait.h>
3a6d7c64 32#include <linux/stop_machine.h>
f2425b4e 33#include <linux/rcu_node_tree.h>
f885b7f2 34
45753c5f
IM
35#include "rcu_segcblist.h"
36
25f3d7ef
PM
37/* Communicate arguments to a workqueue handler. */
38struct rcu_exp_work {
39 smp_call_func_t rew_func;
25f3d7ef
PM
40 unsigned long rew_s;
41 struct work_struct rew_work;
42};
43
d71df90e
PM
44/* RCU's kthread states for tracing. */
45#define RCU_KTHREAD_STOPPED 0
46#define RCU_KTHREAD_RUNNING 1
47#define RCU_KTHREAD_WAITING 2
15ba0ba8
PM
48#define RCU_KTHREAD_OFFCPU 3
49#define RCU_KTHREAD_YIELDING 4
50#define RCU_KTHREAD_MAX 4
d71df90e 51
9f77da9f
PM
52/*
53 * Definition for node within the RCU grace-period-detection hierarchy.
54 */
55struct rcu_node {
67c583a7
BF
56 raw_spinlock_t __private lock; /* Root rcu_node's lock protects */
57 /* some rcu_state fields as well as */
58 /* following. */
de30ad51 59 unsigned long gp_seq; /* Track rsp->rcu_gp_seq. */
7a1d0f23 60 unsigned long gp_seq_needed; /* Track rsp->rcu_gp_seq_needed. */
4bc8d555 61 unsigned long completedqs; /* All QSes done for this node. */
9f77da9f
PM
62 unsigned long qsmask; /* CPUs or groups that need to switch in */
63 /* order for current grace period to proceed.*/
1eba8f84
PM
64 /* In leaf rcu_node, each bit corresponds to */
65 /* an rcu_data structure, otherwise, each */
66 /* bit corresponds to a child rcu_node */
67 /* structure. */
f2e2df59 68 unsigned long rcu_gp_init_mask; /* Mask of offline CPUs at GP init. */
9f77da9f 69 unsigned long qsmaskinit;
b9585e94 70 /* Per-GP initial value for qsmask. */
0aa04b05
PM
71 /* Initialized from ->qsmaskinitnext at the */
72 /* beginning of each grace period. */
73 unsigned long qsmaskinitnext;
74 /* Online CPUs for next grace period. */
b9585e94
PM
75 unsigned long expmask; /* CPUs or groups that need to check in */
76 /* to allow the current expedited GP */
77 /* to complete. */
78 unsigned long expmaskinit;
79 /* Per-GP initial values for expmask. */
80 /* Initialized from ->expmaskinitnext at the */
81 /* beginning of each expedited GP. */
82 unsigned long expmaskinitnext;
83 /* Online CPUs for next expedited GP. */
1de6e56d
PM
84 /* Any CPU that has ever been online will */
85 /* have its bit set. */
9b9500da 86 unsigned long ffmask; /* Fully functional CPUs. */
9f77da9f 87 unsigned long grpmask; /* Mask to apply to parent qsmask. */
1eba8f84 88 /* Only one bit will be set in this mask. */
9f77da9f
PM
89 int grplo; /* lowest-numbered CPU or group here. */
90 int grphi; /* highest-numbered CPU or group here. */
91 u8 grpnum; /* CPU/group number for next level up. */
92 u8 level; /* root is at level 0. */
0aa04b05
PM
93 bool wait_blkd_tasks;/* Necessary to wait for blocked tasks to */
94 /* exit RCU read-side critical sections */
95 /* before propagating offline up the */
96 /* rcu_node tree? */
9f77da9f 97 struct rcu_node *parent;
12f5f524
PM
98 struct list_head blkd_tasks;
99 /* Tasks blocked in RCU read-side critical */
100 /* section. Tasks are placed at the head */
101 /* of this list and age towards the tail. */
102 struct list_head *gp_tasks;
103 /* Pointer to the first task blocking the */
104 /* current grace period, or NULL if there */
105 /* is no such task. */
106 struct list_head *exp_tasks;
107 /* Pointer to the first task blocking the */
108 /* current expedited grace period, or NULL */
109 /* if there is no such task. If there */
110 /* is no current expedited grace period, */
111 /* then there can cannot be any such task. */
27f4d280
PM
112 struct list_head *boost_tasks;
113 /* Pointer to first task that needs to be */
114 /* priority boosted, or NULL if no priority */
115 /* boosting is needed for this rcu_node */
116 /* structure. If there are no tasks */
117 /* queued on this rcu_node structure that */
118 /* are blocking the current grace period, */
119 /* there can be no such task. */
abaa93d9
PM
120 struct rt_mutex boost_mtx;
121 /* Used only for the priority-boosting */
122 /* side effect, not as a lock. */
27f4d280
PM
123 unsigned long boost_time;
124 /* When to start boosting (jiffies). */
125 struct task_struct *boost_kthread_task;
126 /* kthread that takes care of priority */
127 /* boosting for this rcu_node structure. */
d71df90e
PM
128 unsigned int boost_kthread_status;
129 /* State of boost_kthread_task for tracing. */
dae6e64d 130#ifdef CONFIG_RCU_NOCB_CPU
abedf8e2 131 struct swait_queue_head nocb_gp_wq[2];
dae6e64d 132 /* Place for rcu_nocb_kthread() to wait GP. */
dae6e64d 133#endif /* #ifdef CONFIG_RCU_NOCB_CPU */
394f2769 134 raw_spinlock_t fqslock ____cacheline_internodealigned_in_smp;
385b73c0 135
f6a12f34
PM
136 spinlock_t exp_lock ____cacheline_internodealigned_in_smp;
137 unsigned long exp_seq_rq;
3b5f668e 138 wait_queue_head_t exp_wq[4];
25f3d7ef
PM
139 struct rcu_exp_work rew;
140 bool exp_need_flush; /* Need to flush workitem? */
9f77da9f
PM
141} ____cacheline_internodealigned_in_smp;
142
bc75e999
MR
143/*
144 * Bitmasks in an rcu_node cover the interval [grplo, grphi] of CPU IDs, and
145 * are indexed relative to this interval rather than the global CPU ID space.
146 * This generates the bit for a CPU in node-local masks.
147 */
df63fa5b 148#define leaf_node_cpu_bit(rnp, cpu) (BIT((cpu) - (rnp)->grplo))
bc75e999 149
5b74c458
PM
150/*
151 * Union to allow "aggregate OR" operation on the need for a quiescent
152 * state by the normal and expedited grace periods.
153 */
154union rcu_noqs {
155 struct {
156 u8 norm;
157 u8 exp;
158 } b; /* Bits. */
159 u16 s; /* Set of bits, aggregate OR here. */
160};
161
9f77da9f
PM
162/* Per-CPU data for read-copy update. */
163struct rcu_data {
164 /* 1) quiescent-state and grace-period handling : */
de30ad51 165 unsigned long gp_seq; /* Track rsp->rcu_gp_seq counter. */
7a1d0f23 166 unsigned long gp_seq_needed; /* Track rsp->rcu_gp_seq_needed ctr. */
5b74c458 167 union rcu_noqs cpu_no_qs; /* No QSes yet for this CPU. */
97c668b8 168 bool core_needs_qs; /* Core waits for quiesc state. */
9f77da9f 169 bool beenonline; /* CPU online at least once. */
ff3bb6f4 170 bool gpwrap; /* Possible ->gp_seq wrap. */
3e310098 171 bool deferred_qs; /* This CPU awaiting a deferred QS? */
9f77da9f
PM
172 struct rcu_node *mynode; /* This CPU's leaf of hierarchy */
173 unsigned long grpmask; /* Mask to apply to leaf qsmask. */
a858af28
PM
174 unsigned long ticks_this_gp; /* The number of scheduling-clock */
175 /* ticks this CPU has handled */
176 /* during and after the last grace */
177 /* period it is aware of. */
9f77da9f
PM
178
179 /* 2) batch handling */
15fecf89
PM
180 struct rcu_segcblist cblist; /* Segmented callback list, with */
181 /* different callbacks waiting for */
182 /* different grace periods. */
37c72e56
PM
183 long qlen_last_fqs_check;
184 /* qlen at last check for QS forcing */
185 unsigned long n_force_qs_snap;
186 /* did other CPU force QS recently? */
9f77da9f
PM
187 long blimit; /* Upper limit on a processed batch */
188
9f77da9f 189 /* 3) dynticks interface. */
9f77da9f 190 int dynticks_snap; /* Per-GP tracking for dynticks. */
dc5a4f29
PM
191 long dynticks_nesting; /* Track process nesting level. */
192 long dynticks_nmi_nesting; /* Track irq/NMI nesting level. */
193 atomic_t dynticks; /* Even value for idle, else odd. */
194 bool rcu_need_heavy_qs; /* GP old, so heavy quiescent state! */
195 bool rcu_urgent_qs; /* GP old need light quiescent state. */
cc72046c 196#ifdef CONFIG_RCU_FAST_NO_HZ
dc5a4f29
PM
197 bool all_lazy; /* Are all CPU's CBs lazy? */
198 unsigned long nonlazy_posted; /* # times non-lazy CB posted to CPU. */
cc72046c 199 unsigned long nonlazy_posted_snap;
dc5a4f29
PM
200 /* Nonlazy_posted snapshot. */
201 unsigned long last_accelerate; /* Last jiffy CBs were accelerated. */
202 unsigned long last_advance_all; /* Last jiffy CBs were all advanced. */
203 int tick_nohz_enabled_snap; /* Previously seen value from sysfs. */
cc72046c 204#endif /* #ifdef CONFIG_RCU_FAST_NO_HZ */
9f77da9f 205
8d8a9d0e 206 /* 4) rcu_barrier(), OOM callbacks, and expediting. */
06668efa 207 struct rcu_head barrier_head;
0742ac3e 208 int exp_dynticks_snap; /* Double-check need for IPI. */
06668efa 209
8d8a9d0e 210 /* 5) Callback offloading. */
3fbfbf7a
PM
211#ifdef CONFIG_RCU_NOCB_CPU
212 struct rcu_head *nocb_head; /* CBs waiting for kthread. */
213 struct rcu_head **nocb_tail;
41050a00
PM
214 atomic_long_t nocb_q_count; /* # CBs waiting for nocb */
215 atomic_long_t nocb_q_count_lazy; /* invocation (all stages). */
fbce7497
PM
216 struct rcu_head *nocb_follower_head; /* CBs ready to invoke. */
217 struct rcu_head **nocb_follower_tail;
abedf8e2 218 struct swait_queue_head nocb_wq; /* For nocb kthreads to sleep on. */
3fbfbf7a 219 struct task_struct *nocb_kthread;
8be6e1b1 220 raw_spinlock_t nocb_lock; /* Guard following pair of fields. */
9fdd3bc9 221 int nocb_defer_wakeup; /* Defer wakeup of nocb_kthread. */
8be6e1b1 222 struct timer_list nocb_timer; /* Enforce finite deferral. */
fbce7497
PM
223
224 /* The following fields are used by the leader, hence own cacheline. */
225 struct rcu_head *nocb_gp_head ____cacheline_internodealigned_in_smp;
226 /* CBs waiting for GP. */
227 struct rcu_head **nocb_gp_tail;
11ed7f93 228 bool nocb_leader_sleep; /* Is the nocb leader thread asleep? */
fbce7497
PM
229 struct rcu_data *nocb_next_follower;
230 /* Next follower in wakeup chain. */
231
232 /* The following fields are used by the follower, hence new cachline. */
233 struct rcu_data *nocb_leader ____cacheline_internodealigned_in_smp;
234 /* Leader CPU takes GP-end wakeups. */
3fbfbf7a
PM
235#endif /* #ifdef CONFIG_RCU_NOCB_CPU */
236
8d8a9d0e 237 /* 6) Diagnostic data, including RCU CPU stall warnings. */
6231069b 238 unsigned int softirq_snap; /* Snapshot of softirq activity. */
9b9500da
PM
239 /* ->rcu_iw* fields protected by leaf rcu_node ->lock. */
240 struct irq_work rcu_iw; /* Check for non-irq activity. */
241 bool rcu_iw_pending; /* Is ->rcu_iw pending? */
8aa670cd 242 unsigned long rcu_iw_gp_seq; /* ->gp_seq associated with ->rcu_iw. */
57738942
PM
243 unsigned long rcu_ofl_gp_seq; /* ->gp_seq at last offline. */
244 short rcu_ofl_gp_flags; /* ->gp_flags at last offline. */
245 unsigned long rcu_onl_gp_seq; /* ->gp_seq at last online. */
246 short rcu_onl_gp_flags; /* ->gp_flags at last online. */
d3052109 247 unsigned long last_fqs_resched; /* Time of last rcu_resched(). */
6231069b 248
9f77da9f
PM
249 int cpu;
250};
251
9fdd3bc9 252/* Values for nocb_defer_wakeup field in struct rcu_data. */
511324e4
PM
253#define RCU_NOCB_WAKE_NOT 0
254#define RCU_NOCB_WAKE 1
255#define RCU_NOCB_WAKE_FORCE 2
9fdd3bc9 256
026ad283
PM
257#define RCU_JIFFIES_TILL_FORCE_QS (1 + (HZ > 250) + (HZ > 500))
258 /* For jiffies_till_first_fqs and */
259 /* and jiffies_till_next_fqs. */
007b0924 260
026ad283
PM
261#define RCU_JIFFIES_FQS_DIV 256 /* Very large systems need more */
262 /* delay between bouts of */
263 /* quiescent-state forcing. */
264
265#define RCU_STALL_RAT_DELAY 2 /* Allow other CPUs time to take */
266 /* at least one scheduling clock */
267 /* irq before ratting on them. */
9f77da9f 268
08bca60a
PZ
269#define rcu_wait(cond) \
270do { \
271 for (;;) { \
272 set_current_state(TASK_INTERRUPTIBLE); \
273 if (cond) \
274 break; \
275 schedule(); \
276 } \
277 __set_current_state(TASK_RUNNING); \
278} while (0)
9f77da9f
PM
279
280/*
281 * RCU global state, including node hierarchy. This hierarchy is
282 * represented in "heap" form in a dense array. The root (first level)
283 * of the hierarchy is in ->node[0] (referenced by ->level[0]), the second
284 * level in ->node[1] through ->node[m] (->node[1] referenced by ->level[1]),
285 * and the third level in ->node[m+1] and following (->node[m+1] referenced
286 * by ->level[2]). The number of levels is determined by the number of
287 * CPUs and by CONFIG_RCU_FANOUT. Small systems will have a "hierarchy"
288 * consisting of a single rcu_node.
289 */
290struct rcu_state {
291 struct rcu_node node[NUM_RCU_NODES]; /* Hierarchy. */
032dfc87
AG
292 struct rcu_node *level[RCU_NUM_LVLS + 1];
293 /* Hierarchy levels (+1 to */
294 /* shut bogus gcc warning) */
b9585e94 295 int ncpus; /* # CPUs seen so far. */
9f77da9f
PM
296
297 /* The following fields are guarded by the root rcu_node's lock. */
298
77f81fe0
PM
299 u8 boost ____cacheline_internodealigned_in_smp;
300 /* Subject to priority boost. */
de30ad51 301 unsigned long gp_seq; /* Grace-period sequence #. */
b3dbec76 302 struct task_struct *gp_kthread; /* Task for grace periods. */
abedf8e2 303 struct swait_queue_head gp_wq; /* Where GP task waits. */
afea227f
PM
304 short gp_flags; /* Commands for GP task. */
305 short gp_state; /* GP kthread sleep state. */
1eba8f84 306
d9a3da06 307 /* End of fields guarded by root rcu_node's lock. */
1eba8f84 308
7be7f0be 309 struct mutex barrier_mutex; /* Guards barrier fields. */
24ebbca8 310 atomic_t barrier_cpu_count; /* # CPUs waiting on. */
7db74df8 311 struct completion barrier_completion; /* Wake at barrier end. */
4f525a52 312 unsigned long barrier_sequence; /* ++ at start and end of */
dd46a788 313 /* rcu_barrier(). */
a4fbe35a
PM
314 /* End of fields guarded by barrier_mutex. */
315
f6a12f34 316 struct mutex exp_mutex; /* Serialize expedited GP. */
3b5f668e 317 struct mutex exp_wake_mutex; /* Serialize wakeup. */
d6ada2cf 318 unsigned long expedited_sequence; /* Take a ticket. */
3a6d7c64 319 atomic_t expedited_need_qs; /* # CPUs left to check in. */
abedf8e2 320 struct swait_queue_head expedited_wq; /* Wait for check-ins. */
b9585e94 321 int ncpus_snap; /* # CPUs seen last time. */
40694d66 322
9f77da9f
PM
323 unsigned long jiffies_force_qs; /* Time at which to invoke */
324 /* force_quiescent_state(). */
8c7c4829
PM
325 unsigned long jiffies_kick_kthreads; /* Time at which to kick */
326 /* kthreads, if configured. */
9f77da9f
PM
327 unsigned long n_force_qs; /* Number of calls to */
328 /* force_quiescent_state(). */
9f77da9f
PM
329 unsigned long gp_start; /* Time at which GP started, */
330 /* but in jiffies. */
6ccd2ecd
PM
331 unsigned long gp_activity; /* Time of last GP kthread */
332 /* activity in jiffies. */
26d950a9
PM
333 unsigned long gp_req_activity; /* Time of last GP request */
334 /* in jiffies. */
9f77da9f
PM
335 unsigned long jiffies_stall; /* Time at which to check */
336 /* for CPU stalls. */
6193c76a
PM
337 unsigned long jiffies_resched; /* Time at which to resched */
338 /* a reluctant CPU. */
fc908ed3
PM
339 unsigned long n_force_qs_gpstart; /* Snapshot of n_force_qs at */
340 /* GP start. */
15ba0ba8
PM
341 unsigned long gp_max; /* Maximum GP duration in */
342 /* jiffies. */
e66c33d5 343 const char *name; /* Name of structure. */
a4889858 344 char abbr; /* Abbreviated name. */
1e64b15a 345
894d45bb 346 raw_spinlock_t ofl_lock ____cacheline_internodealigned_in_smp;
1e64b15a
PM
347 /* Synchronize offline with */
348 /* GP pre-initialization. */
9f77da9f
PM
349};
350
4cdfc175
PM
351/* Values for rcu_state structure's gp_flags field. */
352#define RCU_GP_FLAG_INIT 0x1 /* Need grace-period initialization. */
353#define RCU_GP_FLAG_FQS 0x2 /* Need grace-period quiescent-state forcing. */
354
c34d2f41 355/* Values for rcu_state structure's gp_state field. */
77f81fe0 356#define RCU_GP_IDLE 0 /* Initial state and no GP in progress. */
afea227f 357#define RCU_GP_WAIT_GPS 1 /* Wait for grace-period start. */
319362c9 358#define RCU_GP_DONE_GPS 2 /* Wait done for grace-period start. */
fea3f222
PM
359#define RCU_GP_ONOFF 3 /* Grace-period initialization hotplug. */
360#define RCU_GP_INIT 4 /* Grace-period initialization. */
361#define RCU_GP_WAIT_FQS 5 /* Wait for force-quiescent-state time. */
362#define RCU_GP_DOING_FQS 6 /* Wait done for force-quiescent-state time. */
363#define RCU_GP_CLEANUP 7 /* Grace-period cleanup started. */
364#define RCU_GP_CLEANED 8 /* Grace-period cleanup complete. */
afea227f 365
6b50e119
PM
366static const char * const gp_state_names[] = {
367 "RCU_GP_IDLE",
368 "RCU_GP_WAIT_GPS",
369 "RCU_GP_DONE_GPS",
fea3f222
PM
370 "RCU_GP_ONOFF",
371 "RCU_GP_INIT",
6b50e119
PM
372 "RCU_GP_WAIT_FQS",
373 "RCU_GP_DOING_FQS",
374 "RCU_GP_CLEANUP",
375 "RCU_GP_CLEANED",
376};
358be2d3
PM
377
378/*
379 * In order to export the rcu_state name to the tracing tools, it
380 * needs to be added in the __tracepoint_string section.
381 * This requires defining a separate variable tp_<sname>_varname
382 * that points to the string being used, and this will allow
383 * the tracing userspace tools to be able to decipher the string
384 * address to the matching string.
385 */
386#ifdef CONFIG_PREEMPT_RCU
387#define RCU_ABBR 'p'
388#define RCU_NAME_RAW "rcu_preempt"
389#else /* #ifdef CONFIG_PREEMPT_RCU */
390#define RCU_ABBR 's'
391#define RCU_NAME_RAW "rcu_sched"
392#endif /* #else #ifdef CONFIG_PREEMPT_RCU */
393#ifndef CONFIG_TRACING
394#define RCU_NAME RCU_NAME_RAW
395#else /* #ifdef CONFIG_TRACING */
396static char rcu_name[] = RCU_NAME_RAW;
397static const char *tp_rcu_varname __used __tracepoint_string = rcu_name;
398#define RCU_NAME rcu_name
399#endif /* #else #ifdef CONFIG_TRACING */
6b50e119 400
6258c4fb
IM
401/*
402 * RCU implementation internal declarations:
403 */
d6714c22 404extern struct rcu_state rcu_sched_state;
6258c4fb
IM
405
406extern struct rcu_state rcu_bh_state;
6258c4fb 407
28f6569a 408#ifdef CONFIG_PREEMPT_RCU
f41d911f 409extern struct rcu_state rcu_preempt_state;
28f6569a 410#endif /* #ifdef CONFIG_PREEMPT_RCU */
f41d911f 411
dc5a4f29 412int rcu_dynticks_snap(struct rcu_data *rdp);
02a5c550 413
eab0993c
PM
414#ifdef CONFIG_RCU_BOOST
415DECLARE_PER_CPU(unsigned int, rcu_cpu_kthread_status);
416DECLARE_PER_CPU(int, rcu_cpu_kthread_cpu);
417DECLARE_PER_CPU(unsigned int, rcu_cpu_kthread_loops);
418DECLARE_PER_CPU(char, rcu_cpu_has_work);
419#endif /* #ifdef CONFIG_RCU_BOOST */
420
9b2619af 421/* Forward declarations for rcutree_plugin.h */
dbe01350 422static void rcu_bootup_announce(void);
45975c7d 423static void rcu_qs(void);
27f4d280 424static int rcu_preempt_blocked_readers_cgp(struct rcu_node *rnp);
b668c9cf 425#ifdef CONFIG_HOTPLUG_CPU
8af3a5e7 426static bool rcu_preempt_has_tasks(struct rcu_node *rnp);
b668c9cf 427#endif /* #ifdef CONFIG_HOTPLUG_CPU */
a2887cd8 428static void rcu_print_detail_task_stall(void);
9bc8b558 429static int rcu_print_task_stall(struct rcu_node *rnp);
74611ecb 430static int rcu_print_task_exp_stall(struct rcu_node *rnp);
81ab59a3 431static void rcu_preempt_check_blocked_tasks(struct rcu_node *rnp);
45975c7d 432static void rcu_flavor_check_callbacks(int user);
b6a4ae76 433void call_rcu(struct rcu_head *head, rcu_callback_t func);
81ab59a3 434static void dump_blkd_tasks(struct rcu_node *rnp, int ncheck);
1217ed1b 435static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags);
a46e0899
PM
436static void rcu_preempt_boost_start_gp(struct rcu_node *rnp);
437static void invoke_rcu_callbacks_kthread(void);
dff1672d 438static bool rcu_is_callbacks_kthread(void);
9386c0b7 439static void __init rcu_spawn_boost_kthreads(void);
49fb4c62 440static void rcu_prepare_kthreads(int cpu);
8fa7845d 441static void rcu_cleanup_after_idle(void);
198bbf81 442static void rcu_prepare_for_idle(void);
c57afe80 443static void rcu_idle_count_callbacks_posted(void);
0aa04b05 444static bool rcu_preempt_has_tasks(struct rcu_node *rnp);
3e310098
PM
445static bool rcu_preempt_need_deferred_qs(struct task_struct *t);
446static void rcu_preempt_deferred_qs(struct task_struct *t);
a858af28 447static void print_cpu_stall_info_begin(void);
b21ebed9 448static void print_cpu_stall_info(int cpu);
a858af28
PM
449static void print_cpu_stall_info_end(void);
450static void zero_cpu_stall_ticks(struct rcu_data *rdp);
4580b054 451static bool rcu_nocb_cpu_needs_barrier(int cpu);
abedf8e2
PG
452static struct swait_queue_head *rcu_nocb_gp_get(struct rcu_node *rnp);
453static void rcu_nocb_gp_cleanup(struct swait_queue_head *sq);
dae6e64d 454static void rcu_init_one_nocb(struct rcu_node *rnp);
3fbfbf7a 455static bool __call_rcu_nocb(struct rcu_data *rdp, struct rcu_head *rhp,
96d3fd0d 456 bool lazy, unsigned long flags);
b1a2d79f 457static bool rcu_nocb_adopt_orphan_cbs(struct rcu_data *my_rdp,
96d3fd0d
PM
458 struct rcu_data *rdp,
459 unsigned long flags);
9fdd3bc9 460static int rcu_nocb_need_deferred_wakeup(struct rcu_data *rdp);
96d3fd0d 461static void do_nocb_deferred_wakeup(struct rcu_data *rdp);
3fbfbf7a 462static void rcu_boot_init_nocb_percpu_data(struct rcu_data *rdp);
35ce7f29
PM
463static void rcu_spawn_all_nocb_kthreads(int cpu);
464static void __init rcu_spawn_nocb_kthreads(void);
465#ifdef CONFIG_RCU_NOCB_CPU
4580b054 466static void __init rcu_organize_nocb_kthreads(void);
35ce7f29 467#endif /* #ifdef CONFIG_RCU_NOCB_CPU */
34ed6246 468static bool init_nocb_callback_list(struct rcu_data *rdp);
eb75767b 469static void rcu_bind_gp_kthread(void);
4580b054 470static bool rcu_nohz_full_cpu(void);
176f8f7a
PM
471static void rcu_dynticks_task_enter(void);
472static void rcu_dynticks_task_exit(void);
9b2619af 473
da915ad5
PM
474#ifdef CONFIG_SRCU
475void srcu_online_cpu(unsigned int cpu);
476void srcu_offline_cpu(unsigned int cpu);
477#else /* #ifdef CONFIG_SRCU */
478void srcu_online_cpu(unsigned int cpu) { }
479void srcu_offline_cpu(unsigned int cpu) { }
480#endif /* #else #ifdef CONFIG_SRCU */