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