blob: 79ce9891a8c73424a8ba388561c94eddfff2c26f [file] [log] [blame]
Paul E. McKenney64db4cf2008-12-18 21:55:32 +01001CONFIG_RCU_TRACE debugfs Files and Formats
2
3
Paul E. McKenney8e79e1f2010-11-04 14:31:19 -07004The rcutree and rcutiny implementations of RCU provide debugfs trace
5output that summarizes counters and state. This information is useful for
6debugging RCU itself, and can sometimes also help to debug abuses of RCU.
7The following sections describe the debugfs files and formats, first
8for rcutree and next for rcutiny.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +01009
10
Paul E. McKenney8e79e1f2010-11-04 14:31:19 -070011CONFIG_TREE_RCU and CONFIG_TREE_PREEMPT_RCU debugfs Files and Formats
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010012
Paul E. McKenney40e80c42012-10-31 13:00:15 -070013These implementations of RCU provide several debugfs directories under the
Paul E. McKenney90e6ac32011-04-06 15:20:47 -070014top-level directory "rcu":
15
Paul E. McKenney40e80c42012-10-31 13:00:15 -070016rcu/rcu_bh
17rcu/rcu_preempt
18rcu/rcu_sched
19
20Each directory contains files for the corresponding flavor of RCU.
21Note that rcu/rcu_preempt is only present for CONFIG_TREE_PREEMPT_RCU.
22For CONFIG_TREE_RCU, the RCU flavor maps onto the RCU-sched flavor,
23so that activity for both appears in rcu/rcu_sched.
24
25In addition, the following file appears in the top-level directory:
26rcu/rcutorture. This file displays rcutorture test progress. The output
27of "cat rcu/rcutorture" looks as follows:
28
29rcutorture test sequence: 0 (test in progress)
30rcutorture update version number: 615
31
32The first line shows the number of rcutorture tests that have completed
33since boot. If a test is currently running, the "(test in progress)"
34string will appear as shown above. The second line shows the number of
35update cycles that the current test has started, or zero if there is
36no test in progress.
37
38
39Within each flavor directory (rcu/rcu_bh, rcu/rcu_sched, and possibly
40also rcu/rcu_preempt) the following files will be present:
41
42rcudata:
Paul E. McKenney90e6ac32011-04-06 15:20:47 -070043 Displays fields in struct rcu_data.
Paul E. McKenney40e80c42012-10-31 13:00:15 -070044rcugp:
Paul E. McKenney90e6ac32011-04-06 15:20:47 -070045 Displays grace-period counters.
Paul E. McKenney40e80c42012-10-31 13:00:15 -070046rcuhier:
Paul E. McKenney90e6ac32011-04-06 15:20:47 -070047 Displays the struct rcu_node hierarchy.
Paul E. McKenney40e80c42012-10-31 13:00:15 -070048rcu_pending:
Paul E. McKenney90e6ac32011-04-06 15:20:47 -070049 Displays counts of the reasons rcu_pending() decided that RCU had
50 work to do.
Paul E. McKenney40e80c42012-10-31 13:00:15 -070051rcuboost:
Paul E. McKenney90e6ac32011-04-06 15:20:47 -070052 Displays RCU boosting statistics. Only present if
53 CONFIG_RCU_BOOST=y.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010054
Paul E. McKenney40e80c42012-10-31 13:00:15 -070055The output of "cat rcu/rcu_preempt/rcudata" looks as follows:
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010056
Paul E. McKenney40e80c42012-10-31 13:00:15 -070057 0!c=30455 g=30456 pq=1 qp=1 dt=126535/140000000000000/0 df=2002 of=4 ql=0/0 qs=N... b=10 ci=74572 nci=0 co=1131 ca=716
58 1!c=30719 g=30720 pq=1 qp=0 dt=132007/140000000000000/0 df=1874 of=10 ql=0/0 qs=N... b=10 ci=123209 nci=0 co=685 ca=982
59 2!c=30150 g=30151 pq=1 qp=1 dt=138537/140000000000000/0 df=1707 of=8 ql=0/0 qs=N... b=10 ci=80132 nci=0 co=1328 ca=1458
60 3 c=31249 g=31250 pq=1 qp=0 dt=107255/140000000000000/0 df=1749 of=6 ql=0/450 qs=NRW. b=10 ci=151700 nci=0 co=509 ca=622
61 4!c=29502 g=29503 pq=1 qp=1 dt=83647/140000000000000/0 df=965 of=5 ql=0/0 qs=N... b=10 ci=65643 nci=0 co=1373 ca=1521
62 5 c=31201 g=31202 pq=1 qp=1 dt=70422/0/0 df=535 of=7 ql=0/0 qs=.... b=10 ci=58500 nci=0 co=764 ca=698
63 6!c=30253 g=30254 pq=1 qp=1 dt=95363/140000000000000/0 df=780 of=5 ql=0/0 qs=N... b=10 ci=100607 nci=0 co=1414 ca=1353
64 7 c=31178 g=31178 pq=1 qp=0 dt=91536/0/0 df=547 of=4 ql=0/0 qs=.... b=10 ci=109819 nci=0 co=1115 ca=969
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010065
Paul E. McKenney40e80c42012-10-31 13:00:15 -070066This file has one line per CPU, or eight for this 8-CPU system.
67The fields are as follows:
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010068
69o The number at the beginning of each line is the CPU number.
70 CPUs numbers followed by an exclamation mark are offline,
71 but have been online at least once since boot. There will be
72 no output for CPUs that have never been online, which can be
73 a good thing in the surprisingly common case where NR_CPUS is
74 substantially larger than the number of actual CPUs.
75
76o "c" is the count of grace periods that this CPU believes have
Paul E. McKenney40e80c42012-10-31 13:00:15 -070077 completed. Offlined CPUs and CPUs in dynticks idle mode may lag
78 quite a ways behind, for example, CPU 4 under "rcu_sched" above,
79 which has been offline through 16 RCU grace periods. It is not
80 unusual to see offline CPUs lagging by thousands of grace periods.
81 Note that although the grace-period number is an unsigned long,
82 it is printed out as a signed long to allow more human-friendly
83 representation near boot time.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010084
85o "g" is the count of grace periods that this CPU believes have
Paul E. McKenney2fa218d2011-03-27 21:37:58 -070086 started. Again, offlined CPUs and CPUs in dynticks idle mode
87 may lag behind. If the "c" and "g" values are equal, this CPU
88 has already reported a quiescent state for the last RCU grace
89 period that it is aware of, otherwise, the CPU believes that it
90 owes RCU a quiescent state.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010091
92o "pq" indicates that this CPU has passed through a quiescent state
93 for the current grace period. It is possible for "pq" to be
94 "1" and "c" different than "g", which indicates that although
95 the CPU has passed through a quiescent state, either (1) this
96 CPU has not yet reported that fact, (2) some other CPU has not
97 yet reported for this grace period, or (3) both.
98
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010099o "qp" indicates that RCU still expects a quiescent state from
Paul E. McKenney2fa218d2011-03-27 21:37:58 -0700100 this CPU. Offlined CPUs and CPUs in dyntick idle mode might
101 well have qp=1, which is OK: RCU is still ignoring them.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100102
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100103o "dt" is the current value of the dyntick counter that is incremented
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700104 when entering or leaving idle, either due to a context switch or
105 due to an interrupt. This number is even if the CPU is in idle
106 from RCU's viewpoint and odd otherwise. The number after the
107 first "/" is the interrupt nesting depth when in idle state,
108 or a large number added to the interrupt-nesting depth when
109 running a non-idle task. Some architectures do not accurately
110 count interrupt nesting when running in non-idle kernel context,
111 which can result in interesting anomalies such as negative
112 interrupt-nesting levels. The number after the second "/"
113 is the NMI nesting depth.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100114
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100115o "df" is the number of times that some other CPU has forced a
116 quiescent state on behalf of this CPU due to this CPU being in
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700117 idle state.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100118
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100119o "of" is the number of times that some other CPU has forced a
120 quiescent state on behalf of this CPU due to this CPU being
Paul E. McKenney2fa218d2011-03-27 21:37:58 -0700121 offline. In a perfect world, this might never happen, but it
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100122 turns out that offlining and onlining a CPU can take several grace
123 periods, and so there is likely to be an extended period of time
124 when RCU believes that the CPU is online when it really is not.
125 Please note that erring in the other direction (RCU believing a
126 CPU is offline when it is really alive and kicking) is a fatal
127 error, so it makes sense to err conservatively.
128
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100129o "ql" is the number of RCU callbacks currently residing on
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700130 this CPU. The first number is the number of "lazy" callbacks
131 that are known to RCU to only be freeing memory, and the number
132 after the "/" is the total number of callbacks, lazy or not.
133 These counters count callbacks regardless of what phase of
134 grace-period processing that they are in (new, waiting for
135 grace period to start, waiting for grace period to end, ready
136 to invoke).
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100137
Paul E. McKenney0ac3d132011-03-28 15:47:07 -0700138o "qs" gives an indication of the state of the callback queue
139 with four characters:
140
141 "N" Indicates that there are callbacks queued that are not
142 ready to be handled by the next grace period, and thus
143 will be handled by the grace period following the next
144 one.
145
146 "R" Indicates that there are callbacks queued that are
147 ready to be handled by the next grace period.
148
149 "W" Indicates that there are callbacks queued that are
150 waiting on the current grace period.
151
152 "D" Indicates that there are callbacks queued that have
153 already been handled by a prior grace period, and are
154 thus waiting to be invoked. Note that callbacks in
155 the process of being invoked are not counted here.
156 Callbacks in the process of being invoked are those
157 that have been removed from the rcu_data structures
158 queues by rcu_do_batch(), but which have not yet been
159 invoked.
160
161 If there are no callbacks in a given one of the above states,
162 the corresponding character is replaced by ".".
163
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700164o "b" is the batch limit for this CPU. If more than this number
165 of RCU callbacks is ready to invoke, then the remainder will
166 be deferred.
167
168o "ci" is the number of RCU callbacks that have been invoked for
169 this CPU. Note that ci+nci+ql is the number of callbacks that have
170 been registered in absence of CPU-hotplug activity.
171
172o "nci" is the number of RCU callbacks that have been offloaded from
173 this CPU. This will always be zero unless the kernel was built
174 with CONFIG_RCU_NOCB_CPU=y and the "rcu_nocbs=" kernel boot
175 parameter was specified.
176
177o "co" is the number of RCU callbacks that have been orphaned due to
178 this CPU going offline. These orphaned callbacks have been moved
179 to an arbitrarily chosen online CPU.
180
181o "ca" is the number of RCU callbacks that have been adopted by this
182 CPU due to other CPUs going offline. Note that ci+co-ca+ql is
183 the number of RCU callbacks registered on this CPU.
184
185
186Kernels compiled with CONFIG_RCU_BOOST=y display the following from
187/debug/rcu/rcu_preempt/rcudata:
188
189 0!c=12865 g=12866 pq=1 qp=1 dt=83113/140000000000000/0 df=288 of=11 ql=0/0 qs=N... kt=0/O ktl=944 b=10 ci=60709 nci=0 co=748 ca=871
190 1 c=14407 g=14408 pq=1 qp=0 dt=100679/140000000000000/0 df=378 of=7 ql=0/119 qs=NRW. kt=0/W ktl=9b6 b=10 ci=109740 nci=0 co=589 ca=485
191 2 c=14407 g=14408 pq=1 qp=0 dt=105486/0/0 df=90 of=9 ql=0/89 qs=NRW. kt=0/W ktl=c0c b=10 ci=83113 nci=0 co=533 ca=490
192 3 c=14407 g=14408 pq=1 qp=0 dt=107138/0/0 df=142 of=8 ql=0/188 qs=NRW. kt=0/W ktl=b96 b=10 ci=121114 nci=0 co=426 ca=290
193 4 c=14405 g=14406 pq=1 qp=1 dt=50238/0/0 df=706 of=7 ql=0/0 qs=.... kt=0/W ktl=812 b=10 ci=34929 nci=0 co=643 ca=114
194 5!c=14168 g=14169 pq=1 qp=0 dt=45465/140000000000000/0 df=161 of=11 ql=0/0 qs=N... kt=0/O ktl=b4d b=10 ci=47712 nci=0 co=677 ca=722
195 6 c=14404 g=14405 pq=1 qp=0 dt=59454/0/0 df=94 of=6 ql=0/0 qs=.... kt=0/W ktl=e57 b=10 ci=55597 nci=0 co=701 ca=811
196 7 c=14407 g=14408 pq=1 qp=1 dt=68850/0/0 df=31 of=8 ql=0/0 qs=.... kt=0/W ktl=14bd b=10 ci=77475 nci=0 co=508 ca=1042
197
198This is similar to the output discussed above, but contains the following
199additional fields:
200
Paul E. McKenney90e6ac32011-04-06 15:20:47 -0700201o "kt" is the per-CPU kernel-thread state. The digit preceding
Paul E. McKenney15ba0ba2011-04-06 16:01:16 -0700202 the first slash is zero if there is no work pending and 1
Paul E. McKenney5ece5ba2011-04-22 18:08:51 -0700203 otherwise. The character between the first pair of slashes is
204 as follows:
Paul E. McKenney90e6ac32011-04-06 15:20:47 -0700205
206 "S" The kernel thread is stopped, in other words, all
207 CPUs corresponding to this rcu_node structure are
208 offline.
209
210 "R" The kernel thread is running.
211
212 "W" The kernel thread is waiting because there is no work
213 for it to do.
214
Paul E. McKenney15ba0ba2011-04-06 16:01:16 -0700215 "O" The kernel thread is waiting because it has been
216 forced off of its designated CPU or because its
217 ->cpus_allowed mask permits it to run on other than
218 its designated CPU.
219
Paul E. McKenney90e6ac32011-04-06 15:20:47 -0700220 "Y" The kernel thread is yielding to avoid hogging CPU.
221
222 "?" Unknown value, indicates a bug.
223
Paul E. McKenney15ba0ba2011-04-06 16:01:16 -0700224 The number after the final slash is the CPU that the kthread
225 is actually running on.
226
Paul E. McKenneyd5988af2011-06-15 23:07:55 -0700227 This field is displayed only for CONFIG_RCU_BOOST kernels.
228
Paul E. McKenney5ece5ba2011-04-22 18:08:51 -0700229o "ktl" is the low-order 16 bits (in hexadecimal) of the count of
230 the number of times that this CPU's per-CPU kthread has gone
231 through its loop servicing invoke_rcu_cpu_kthread() requests.
232
Paul E. McKenneyd5988af2011-06-15 23:07:55 -0700233 This field is displayed only for CONFIG_RCU_BOOST kernels.
234
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100235
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700236The output of "cat rcu/rcu_preempt/rcugp" looks as follows:
Paul E. McKenney269dcc12010-09-07 14:23:09 -0700237
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700238completed=31249 gpnum=31250 age=1 max=18
Paul E. McKenney269dcc12010-09-07 14:23:09 -0700239
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700240These fields are taken from the rcu_state structure, and are as follows:
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100241
242o "completed" is the number of grace periods that have completed.
243 It is comparable to the "c" field from rcu/rcudata in that a
244 CPU whose "c" field matches the value of "completed" is aware
245 that the corresponding RCU grace period has completed.
246
247o "gpnum" is the number of grace periods that have started. It is
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700248 similarly comparable to the "g" field from rcu/rcudata in that
249 a CPU whose "g" field matches the value of "gpnum" is aware that
250 the corresponding RCU grace period has started.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100251
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700252 If these two fields are equal, then there is no grace period
253 in progress, in other words, RCU is idle. On the other hand,
254 if the two fields differ (as they are above), then an RCU grace
255 period is in progress.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100256
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700257o "age" is the number of jiffies that the current grace period
258 has extended for, or zero if there is no grace period currently
259 in effect.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100260
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700261o "max" is the age in jiffies of the longest-duration grace period
262 thus far.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100263
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700264The output of "cat rcu/rcu_preempt/rcuhier" looks as follows:
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100265
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700266c=14407 g=14408 s=0 jfq=2 j=c863 nfqs=12040/nfqsng=0(12040) fqlh=1051 oqlen=0/0
2673/3 ..>. 0:7 ^0
268e/e ..>. 0:3 ^0 d/d ..>. 4:7 ^1
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100269
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700270The fields are as follows:
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100271
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700272o "c" is exactly the same as "completed" under rcu/rcu_preempt/rcugp.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100273
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700274o "g" is exactly the same as "gpnum" under rcu/rcu_preempt/rcugp.
275
276o "s" is the current state of the force_quiescent_state()
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100277 state machine.
278
279o "jfq" is the number of jiffies remaining for this grace period
280 before force_quiescent_state() is invoked to help push things
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700281 along. Note that CPUs in idle mode throughout the grace period
282 will not report on their own, but rather must be check by some
283 other CPU via force_quiescent_state().
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100284
285o "j" is the low-order four hex digits of the jiffies counter.
286 Yes, Paul did run into a number of problems that turned out to
287 be due to the jiffies counter no longer counting. Why do you ask?
288
289o "nfqs" is the number of calls to force_quiescent_state() since
290 boot.
291
292o "nfqsng" is the number of useless calls to force_quiescent_state(),
293 where there wasn't actually a grace period active. This can
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700294 no longer happen due to grace-period processing being pushed
295 into a kthread. The number in parentheses is the difference
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100296 between "nfqs" and "nfqsng", or the number of times that
297 force_quiescent_state() actually did some real work.
298
299o "fqlh" is the number of calls to force_quiescent_state() that
300 exited immediately (without even being counted in nfqs above)
301 due to contention on ->fqslock.
302
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700303o Each element of the form "3/3 ..>. 0:7 ^0" represents one rcu_node
304 structure. Each line represents one level of the hierarchy,
305 from root to leaves. It is best to think of the rcu_data
306 structures as forming yet another level after the leaves.
307 Note that there might be either one, two, three, or even four
308 levels of rcu_node structures, depending on the relationship
309 between CONFIG_RCU_FANOUT, CONFIG_RCU_FANOUT_LEAF (possibly
310 adjusted using the rcu_fanout_leaf kernel boot parameter), and
311 CONFIG_NR_CPUS (possibly adjusted using the nr_cpu_ids count of
312 possible CPUs for the booting hardware).
Paul E. McKenney0edf1a62009-10-14 10:15:59 -0700313
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100314 o The numbers separated by the "/" are the qsmask followed
315 by the qsmaskinit. The qsmask will have one bit
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700316 set for each entity in the next lower level that has
317 not yet checked in for the current grace period ("e"
318 indicating CPUs 5, 6, and 7 in the example above).
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100319 The qsmaskinit will have one bit for each entity that is
320 currently expected to check in during each grace period.
321 The value of qsmaskinit is assigned to that of qsmask
322 at the beginning of each grace period.
323
Paul E. McKenney0edf1a62009-10-14 10:15:59 -0700324 o The characters separated by the ">" indicate the state
Paul E. McKenney12f5f522010-11-29 21:56:39 -0800325 of the blocked-tasks lists. A "G" preceding the ">"
Paul E. McKenney0edf1a62009-10-14 10:15:59 -0700326 indicates that at least one task blocked in an RCU
327 read-side critical section blocks the current grace
Paul E. McKenney12f5f522010-11-29 21:56:39 -0800328 period, while a "E" preceding the ">" indicates that
329 at least one task blocked in an RCU read-side critical
330 section blocks the current expedited grace period.
331 A "T" character following the ">" indicates that at
332 least one task is blocked within an RCU read-side
333 critical section, regardless of whether any current
334 grace period (expedited or normal) is inconvenienced.
335 A "." character appears if the corresponding condition
336 does not hold, so that "..>." indicates that no tasks
337 are blocked. In contrast, "GE>T" indicates maximal
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700338 inconvenience from blocked tasks. CONFIG_TREE_RCU
339 builds of the kernel will always show "..>.".
Paul E. McKenney0edf1a62009-10-14 10:15:59 -0700340
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100341 o The numbers separated by the ":" are the range of CPUs
342 served by this struct rcu_node. This can be helpful
343 in working out how the hierarchy is wired together.
344
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700345 For example, the example rcu_node structure shown above
346 has "0:7", indicating that it covers CPUs 0 through 7.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100347
348 o The number after the "^" indicates the bit in the
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700349 next higher level rcu_node structure that this rcu_node
350 structure corresponds to. For example, the "d/d ..>. 4:7
351 ^1" has a "1" in this position, indicating that it
352 corresponds to the "1" bit in the "3" shown in the
353 "3/3 ..>. 0:7 ^0" entry on the next level up.
Paul E. McKenney6fd9b3a2009-04-13 21:31:18 -0700354
355
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700356The output of "cat rcu/rcu_sched/rcu_pending" looks as follows:
Paul E. McKenney6fd9b3a2009-04-13 21:31:18 -0700357
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700358 0!np=26111 qsp=29 rpq=5386 cbr=1 cng=570 gpc=3674 gps=577 nn=15903
359 1!np=28913 qsp=35 rpq=6097 cbr=1 cng=448 gpc=3700 gps=554 nn=18113
360 2!np=32740 qsp=37 rpq=6202 cbr=0 cng=476 gpc=4627 gps=546 nn=20889
361 3 np=23679 qsp=22 rpq=5044 cbr=1 cng=415 gpc=3403 gps=347 nn=14469
362 4!np=30714 qsp=4 rpq=5574 cbr=0 cng=528 gpc=3931 gps=639 nn=20042
363 5 np=28910 qsp=2 rpq=5246 cbr=0 cng=428 gpc=4105 gps=709 nn=18422
364 6!np=38648 qsp=5 rpq=7076 cbr=0 cng=840 gpc=4072 gps=961 nn=25699
365 7 np=37275 qsp=2 rpq=6873 cbr=0 cng=868 gpc=3416 gps=971 nn=25147
Paul E. McKenney6fd9b3a2009-04-13 21:31:18 -0700366
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700367The fields are as follows:
368
369o The leading number is the CPU number, with "!" indicating
370 an offline CPU.
Paul E. McKenney6fd9b3a2009-04-13 21:31:18 -0700371
372o "np" is the number of times that __rcu_pending() has been invoked
373 for the corresponding flavor of RCU.
374
375o "qsp" is the number of times that the RCU was waiting for a
376 quiescent state from this CPU.
377
Paul E. McKenneyd21670a2010-04-14 17:39:26 -0700378o "rpq" is the number of times that the CPU had passed through
379 a quiescent state, but not yet reported it to RCU.
380
Paul E. McKenney6fd9b3a2009-04-13 21:31:18 -0700381o "cbr" is the number of times that this CPU had RCU callbacks
382 that had passed through a grace period, and were thus ready
383 to be invoked.
384
385o "cng" is the number of times that this CPU needed another
386 grace period while RCU was idle.
387
388o "gpc" is the number of times that an old grace period had
389 completed, but this CPU was not yet aware of it.
390
391o "gps" is the number of times that a new grace period had started,
392 but this CPU was not yet aware of it.
393
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700394o "nn" is the number of times that this CPU needed nothing.
Paul E. McKenney90e6ac32011-04-06 15:20:47 -0700395
396
397The output of "cat rcu/rcuboost" looks as follows:
398
Paul E. McKenney40e80c42012-10-31 13:00:15 -07003990:3 tasks=.... kt=W ntb=0 neb=0 nnb=0 j=c864 bt=c894
400 balk: nt=0 egt=4695 bt=0 nb=0 ny=56 nos=0
4014:7 tasks=.... kt=W ntb=0 neb=0 nnb=0 j=c864 bt=c894
402 balk: nt=0 egt=6541 bt=0 nb=0 ny=126 nos=0
Paul E. McKenney90e6ac32011-04-06 15:20:47 -0700403
404This information is output only for rcu_preempt. Each two-line entry
405corresponds to a leaf rcu_node strcuture. The fields are as follows:
406
407o "n:m" is the CPU-number range for the corresponding two-line
408 entry. In the sample output above, the first entry covers
Paul E. McKenney40e80c42012-10-31 13:00:15 -0700409 CPUs zero through three and the second entry covers CPUs four
410 through seven.
Paul E. McKenney90e6ac32011-04-06 15:20:47 -0700411
412o "tasks=TNEB" gives the state of the various segments of the
413 rnp->blocked_tasks list:
414
415 "T" This indicates that there are some tasks that blocked
416 while running on one of the corresponding CPUs while
417 in an RCU read-side critical section.
418
419 "N" This indicates that some of the blocked tasks are preventing
420 the current normal (non-expedited) grace period from
421 completing.
422
423 "E" This indicates that some of the blocked tasks are preventing
424 the current expedited grace period from completing.
425
426 "B" This indicates that some of the blocked tasks are in
427 need of RCU priority boosting.
428
429 Each character is replaced with "." if the corresponding
430 condition does not hold.
431
432o "kt" is the state of the RCU priority-boosting kernel
433 thread associated with the corresponding rcu_node structure.
434 The state can be one of the following:
435
436 "S" The kernel thread is stopped, in other words, all
437 CPUs corresponding to this rcu_node structure are
438 offline.
439
440 "R" The kernel thread is running.
441
442 "W" The kernel thread is waiting because there is no work
443 for it to do.
444
445 "Y" The kernel thread is yielding to avoid hogging CPU.
446
447 "?" Unknown value, indicates a bug.
448
449o "ntb" is the number of tasks boosted.
450
451o "neb" is the number of tasks boosted in order to complete an
452 expedited grace period.
453
454o "nnb" is the number of tasks boosted in order to complete a
455 normal (non-expedited) grace period. When boosting a task
456 that was blocking both an expedited and a normal grace period,
457 it is counted against the expedited total above.
458
459o "j" is the low-order 16 bits of the jiffies counter in
460 hexadecimal.
461
462o "bt" is the low-order 16 bits of the value that the jiffies
463 counter will have when we next start boosting, assuming that
464 the current grace period does not end beforehand. This is
465 also in hexadecimal.
466
467o "balk: nt" counts the number of times we didn't boost (in
468 other words, we balked) even though it was time to boost because
469 there were no blocked tasks to boost. This situation occurs
470 when there is one blocked task on one rcu_node structure and
471 none on some other rcu_node structure.
472
473o "egt" counts the number of times we balked because although
474 there were blocked tasks, none of them were blocking the
475 current grace period, whether expedited or otherwise.
476
477o "bt" counts the number of times we balked because boosting
478 had already been initiated for the current grace period.
479
480o "nb" counts the number of times we balked because there
481 was at least one task blocking the current non-expedited grace
482 period that never had blocked. If it is already running, it
483 just won't help to boost its priority!
484
485o "ny" counts the number of times we balked because it was
486 not yet time to start boosting.
487
488o "nos" counts the number of times we balked for other
489 reasons, e.g., the grace period ended first.
490
491
Paul E. McKenney8e79e1f2010-11-04 14:31:19 -0700492CONFIG_TINY_RCU and CONFIG_TINY_PREEMPT_RCU debugfs Files and Formats
493
494These implementations of RCU provides a single debugfs file under the
495top-level directory RCU, namely rcu/rcudata, which displays fields in
496rcu_bh_ctrlblk, rcu_sched_ctrlblk and, for CONFIG_TINY_PREEMPT_RCU,
497rcu_preempt_ctrlblk.
498
499The output of "cat rcu/rcudata" is as follows:
500
501rcu_preempt: qlen=24 gp=1097669 g197/p197/c197 tasks=...
502 ttb=. btg=no ntb=184 neb=0 nnb=183 j=01f7 bt=0274
503 normal balk: nt=1097669 gt=0 bt=371 b=0 ny=25073378 nos=0
504 exp balk: bt=0 nos=0
505rcu_sched: qlen: 0
506rcu_bh: qlen: 0
507
508This is split into rcu_preempt, rcu_sched, and rcu_bh sections, with the
509rcu_preempt section appearing only in CONFIG_TINY_PREEMPT_RCU builds.
510The last three lines of the rcu_preempt section appear only in
511CONFIG_RCU_BOOST kernel builds. The fields are as follows:
512
513o "qlen" is the number of RCU callbacks currently waiting either
514 for an RCU grace period or waiting to be invoked. This is the
515 only field present for rcu_sched and rcu_bh, due to the
516 short-circuiting of grace period in those two cases.
517
518o "gp" is the number of grace periods that have completed.
519
520o "g197/p197/c197" displays the grace-period state, with the
521 "g" number being the number of grace periods that have started
522 (mod 256), the "p" number being the number of grace periods
523 that the CPU has responded to (also mod 256), and the "c"
524 number being the number of grace periods that have completed
525 (once again mode 256).
526
527 Why have both "gp" and "g"? Because the data flowing into
528 "gp" is only present in a CONFIG_RCU_TRACE kernel.
529
530o "tasks" is a set of bits. The first bit is "T" if there are
531 currently tasks that have recently blocked within an RCU
532 read-side critical section, the second bit is "N" if any of the
533 aforementioned tasks are blocking the current RCU grace period,
534 and the third bit is "E" if any of the aforementioned tasks are
535 blocking the current expedited grace period. Each bit is "."
536 if the corresponding condition does not hold.
537
538o "ttb" is a single bit. It is "B" if any of the blocked tasks
539 need to be priority boosted and "." otherwise.
540
541o "btg" indicates whether boosting has been carried out during
542 the current grace period, with "exp" indicating that boosting
543 is in progress for an expedited grace period, "no" indicating
544 that boosting has not yet started for a normal grace period,
545 "begun" indicating that boosting has bebug for a normal grace
546 period, and "done" indicating that boosting has completed for
547 a normal grace period.
548
549o "ntb" is the total number of tasks subjected to RCU priority boosting
550 periods since boot.
551
552o "neb" is the number of expedited grace periods that have had
553 to resort to RCU priority boosting since boot.
554
555o "nnb" is the number of normal grace periods that have had
556 to resort to RCU priority boosting since boot.
557
Paul E. McKenney90e6ac32011-04-06 15:20:47 -0700558o "j" is the low-order 16 bits of the jiffies counter in hexadecimal.
Paul E. McKenney8e79e1f2010-11-04 14:31:19 -0700559
Paul E. McKenney90e6ac32011-04-06 15:20:47 -0700560o "bt" is the low-order 16 bits of the value that the jiffies counter
Paul E. McKenney8e79e1f2010-11-04 14:31:19 -0700561 will have at the next time that boosting is scheduled to begin.
562
563o In the line beginning with "normal balk", the fields are as follows:
564
565 o "nt" is the number of times that the system balked from
566 boosting because there were no blocked tasks to boost.
567 Note that the system will balk from boosting even if the
568 grace period is overdue when the currently running task
569 is looping within an RCU read-side critical section.
570 There is no point in boosting in this case, because
571 boosting a running task won't make it run any faster.
572
573 o "gt" is the number of times that the system balked
574 from boosting because, although there were blocked tasks,
575 none of them were preventing the current grace period
576 from completing.
577
578 o "bt" is the number of times that the system balked
579 from boosting because boosting was already in progress.
580
581 o "b" is the number of times that the system balked from
582 boosting because boosting had already completed for
583 the grace period in question.
584
585 o "ny" is the number of times that the system balked from
586 boosting because it was not yet time to start boosting
587 the grace period in question.
588
589 o "nos" is the number of times that the system balked from
590 boosting for inexplicable ("not otherwise specified")
591 reasons. This can actually happen due to races involving
592 increments of the jiffies counter.
593
594o In the line beginning with "exp balk", the fields are as follows:
595
596 o "bt" is the number of times that the system balked from
597 boosting because there were no blocked tasks to boost.
598
599 o "nos" is the number of times that the system balked from
600 boosting for inexplicable ("not otherwise specified")
601 reasons.