blob: 672d19083252499cfe8ca3034f2b59a1ce0557d8 [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. McKenney90e6ac32011-04-06 15:20:47 -070013These implementations of RCU provides several debugfs files under the
14top-level directory "rcu":
15
16rcu/rcudata:
17 Displays fields in struct rcu_data.
18rcu/rcudata.csv:
19 Comma-separated values spreadsheet version of rcudata.
20rcu/rcugp:
21 Displays grace-period counters.
22rcu/rcuhier:
23 Displays the struct rcu_node hierarchy.
24rcu/rcu_pending:
25 Displays counts of the reasons rcu_pending() decided that RCU had
26 work to do.
27rcu/rcutorture:
28 Displays rcutorture test progress.
29rcu/rcuboost:
30 Displays RCU boosting statistics. Only present if
31 CONFIG_RCU_BOOST=y.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010032
33The output of "cat rcu/rcudata" looks as follows:
34
Paul E. McKenneyd6714c22009-08-22 13:56:46 -070035rcu_sched:
Paul E. McKenney2036d942012-01-30 17:02:47 -080036 0 c=20972 g=20973 pq=1 pgp=20973 qp=0 dt=545/1/0 df=50 of=0 ql=163 qs=NRW. kt=0/W/0 ktl=ebc3 b=10 ci=153737 co=0 ca=0
37 1 c=20972 g=20973 pq=1 pgp=20973 qp=0 dt=967/1/0 df=58 of=0 ql=634 qs=NRW. kt=0/W/1 ktl=58c b=10 ci=191037 co=0 ca=0
38 2 c=20972 g=20973 pq=1 pgp=20973 qp=0 dt=1081/1/0 df=175 of=0 ql=74 qs=N.W. kt=0/W/2 ktl=da94 b=10 ci=75991 co=0 ca=0
39 3 c=20942 g=20943 pq=1 pgp=20942 qp=1 dt=1846/0/0 df=404 of=0 ql=0 qs=.... kt=0/W/3 ktl=d1cd b=10 ci=72261 co=0 ca=0
40 4 c=20972 g=20973 pq=1 pgp=20973 qp=0 dt=369/1/0 df=83 of=0 ql=48 qs=N.W. kt=0/W/4 ktl=e0e7 b=10 ci=128365 co=0 ca=0
41 5 c=20972 g=20973 pq=1 pgp=20973 qp=0 dt=381/1/0 df=64 of=0 ql=169 qs=NRW. kt=0/W/5 ktl=fb2f b=10 ci=164360 co=0 ca=0
42 6 c=20972 g=20973 pq=1 pgp=20973 qp=0 dt=1037/1/0 df=183 of=0 ql=62 qs=N.W. kt=0/W/6 ktl=d2ad b=10 ci=65663 co=0 ca=0
43 7 c=20897 g=20897 pq=1 pgp=20896 qp=0 dt=1572/0/0 df=382 of=0 ql=0 qs=.... kt=0/W/7 ktl=cf15 b=10 ci=75006 co=0 ca=0
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010044rcu_bh:
Paul E. McKenney2036d942012-01-30 17:02:47 -080045 0 c=1480 g=1480 pq=1 pgp=1480 qp=0 dt=545/1/0 df=6 of=0 ql=0 qs=.... kt=0/W/0 ktl=ebc3 b=10 ci=0 co=0 ca=0
46 1 c=1480 g=1480 pq=1 pgp=1480 qp=0 dt=967/1/0 df=3 of=0 ql=0 qs=.... kt=0/W/1 ktl=58c b=10 ci=151 co=0 ca=0
47 2 c=1480 g=1480 pq=1 pgp=1480 qp=0 dt=1081/1/0 df=6 of=0 ql=0 qs=.... kt=0/W/2 ktl=da94 b=10 ci=0 co=0 ca=0
48 3 c=1480 g=1480 pq=1 pgp=1480 qp=0 dt=1846/0/0 df=8 of=0 ql=0 qs=.... kt=0/W/3 ktl=d1cd b=10 ci=0 co=0 ca=0
49 4 c=1480 g=1480 pq=1 pgp=1480 qp=0 dt=369/1/0 df=6 of=0 ql=0 qs=.... kt=0/W/4 ktl=e0e7 b=10 ci=0 co=0 ca=0
50 5 c=1480 g=1480 pq=1 pgp=1480 qp=0 dt=381/1/0 df=4 of=0 ql=0 qs=.... kt=0/W/5 ktl=fb2f b=10 ci=0 co=0 ca=0
51 6 c=1480 g=1480 pq=1 pgp=1480 qp=0 dt=1037/1/0 df=6 of=0 ql=0 qs=.... kt=0/W/6 ktl=d2ad b=10 ci=0 co=0 ca=0
52 7 c=1474 g=1474 pq=1 pgp=1473 qp=0 dt=1572/0/0 df=8 of=0 ql=0 qs=.... kt=0/W/7 ktl=cf15 b=10 ci=0 co=0 ca=0
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010053
Paul E. McKenneybd58b432009-10-14 10:15:54 -070054The first section lists the rcu_data structures for rcu_sched, the second
55for rcu_bh. Note that CONFIG_TREE_PREEMPT_RCU kernels will have an
56additional section for rcu_preempt. Each section has one line per CPU,
57or eight for this 8-CPU system. The fields are as follows:
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010058
59o The number at the beginning of each line is the CPU number.
60 CPUs numbers followed by an exclamation mark are offline,
61 but have been online at least once since boot. There will be
62 no output for CPUs that have never been online, which can be
63 a good thing in the surprisingly common case where NR_CPUS is
64 substantially larger than the number of actual CPUs.
65
66o "c" is the count of grace periods that this CPU believes have
Paul E. McKenney2fa218d2011-03-27 21:37:58 -070067 completed. Offlined CPUs and CPUs in dynticks idle mode may
68 lag quite a ways behind, for example, CPU 6 under "rcu_sched"
69 above, which has been offline through not quite 40,000 RCU grace
70 periods. It is not unusual to see CPUs lagging by thousands of
71 grace periods.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010072
73o "g" is the count of grace periods that this CPU believes have
Paul E. McKenney2fa218d2011-03-27 21:37:58 -070074 started. Again, offlined CPUs and CPUs in dynticks idle mode
75 may lag behind. If the "c" and "g" values are equal, this CPU
76 has already reported a quiescent state for the last RCU grace
77 period that it is aware of, otherwise, the CPU believes that it
78 owes RCU a quiescent state.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010079
80o "pq" indicates that this CPU has passed through a quiescent state
81 for the current grace period. It is possible for "pq" to be
82 "1" and "c" different than "g", which indicates that although
83 the CPU has passed through a quiescent state, either (1) this
84 CPU has not yet reported that fact, (2) some other CPU has not
85 yet reported for this grace period, or (3) both.
86
Paul E. McKenneye4cc1f22011-06-27 00:17:43 -070087o "pgp" indicates which grace period the last-observed quiescent
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010088 state for this CPU corresponds to. This is important for handling
89 the race between CPU 0 reporting an extended dynticks-idle
90 quiescent state for CPU 1 and CPU 1 suddenly waking up and
91 reporting its own quiescent state. If CPU 1 was the last CPU
92 for the current grace period, then the CPU that loses this race
93 will attempt to incorrectly mark CPU 1 as having checked in for
94 the next grace period!
95
96o "qp" indicates that RCU still expects a quiescent state from
Paul E. McKenney2fa218d2011-03-27 21:37:58 -070097 this CPU. Offlined CPUs and CPUs in dyntick idle mode might
98 well have qp=1, which is OK: RCU is still ignoring them.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +010099
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100100o "dt" is the current value of the dyntick counter that is incremented
101 when entering or leaving dynticks idle state, either by the
Paul E. McKenney23b5c8f2010-09-07 10:38:22 -0700102 scheduler or by irq. This number is even if the CPU is in
103 dyntick idle mode and odd otherwise. The number after the first
104 "/" is the interrupt nesting depth when in dyntick-idle state,
105 or one greater than the interrupt-nesting depth otherwise.
106 The number after the second "/" is the NMI nesting depth.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100107
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100108o "df" is the number of times that some other CPU has forced a
109 quiescent state on behalf of this CPU due to this CPU being in
110 dynticks-idle state.
111
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100112o "of" is the number of times that some other CPU has forced a
113 quiescent state on behalf of this CPU due to this CPU being
Paul E. McKenney2fa218d2011-03-27 21:37:58 -0700114 offline. In a perfect world, this might never happen, but it
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100115 turns out that offlining and onlining a CPU can take several grace
116 periods, and so there is likely to be an extended period of time
117 when RCU believes that the CPU is online when it really is not.
118 Please note that erring in the other direction (RCU believing a
119 CPU is offline when it is really alive and kicking) is a fatal
120 error, so it makes sense to err conservatively.
121
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100122o "ql" is the number of RCU callbacks currently residing on
123 this CPU. This is the total number of callbacks, regardless
124 of what state they are in (new, waiting for grace period to
125 start, waiting for grace period to end, ready to invoke).
126
Paul E. McKenney0ac3d132011-03-28 15:47:07 -0700127o "qs" gives an indication of the state of the callback queue
128 with four characters:
129
130 "N" Indicates that there are callbacks queued that are not
131 ready to be handled by the next grace period, and thus
132 will be handled by the grace period following the next
133 one.
134
135 "R" Indicates that there are callbacks queued that are
136 ready to be handled by the next grace period.
137
138 "W" Indicates that there are callbacks queued that are
139 waiting on the current grace period.
140
141 "D" Indicates that there are callbacks queued that have
142 already been handled by a prior grace period, and are
143 thus waiting to be invoked. Note that callbacks in
144 the process of being invoked are not counted here.
145 Callbacks in the process of being invoked are those
146 that have been removed from the rcu_data structures
147 queues by rcu_do_batch(), but which have not yet been
148 invoked.
149
150 If there are no callbacks in a given one of the above states,
151 the corresponding character is replaced by ".".
152
Paul E. McKenney90e6ac32011-04-06 15:20:47 -0700153o "kt" is the per-CPU kernel-thread state. The digit preceding
Paul E. McKenney15ba0ba2011-04-06 16:01:16 -0700154 the first slash is zero if there is no work pending and 1
Paul E. McKenney5ece5ba2011-04-22 18:08:51 -0700155 otherwise. The character between the first pair of slashes is
156 as follows:
Paul E. McKenney90e6ac32011-04-06 15:20:47 -0700157
158 "S" The kernel thread is stopped, in other words, all
159 CPUs corresponding to this rcu_node structure are
160 offline.
161
162 "R" The kernel thread is running.
163
164 "W" The kernel thread is waiting because there is no work
165 for it to do.
166
Paul E. McKenney15ba0ba2011-04-06 16:01:16 -0700167 "O" The kernel thread is waiting because it has been
168 forced off of its designated CPU or because its
169 ->cpus_allowed mask permits it to run on other than
170 its designated CPU.
171
Paul E. McKenney90e6ac32011-04-06 15:20:47 -0700172 "Y" The kernel thread is yielding to avoid hogging CPU.
173
174 "?" Unknown value, indicates a bug.
175
Paul E. McKenney15ba0ba2011-04-06 16:01:16 -0700176 The number after the final slash is the CPU that the kthread
177 is actually running on.
178
Paul E. McKenneyd5988af2011-06-15 23:07:55 -0700179 This field is displayed only for CONFIG_RCU_BOOST kernels.
180
Paul E. McKenney5ece5ba2011-04-22 18:08:51 -0700181o "ktl" is the low-order 16 bits (in hexadecimal) of the count of
182 the number of times that this CPU's per-CPU kthread has gone
183 through its loop servicing invoke_rcu_cpu_kthread() requests.
184
Paul E. McKenneyd5988af2011-06-15 23:07:55 -0700185 This field is displayed only for CONFIG_RCU_BOOST kernels.
186
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100187o "b" is the batch limit for this CPU. If more than this number
188 of RCU callbacks is ready to invoke, then the remainder will
189 be deferred.
190
Paul E. McKenney269dcc12010-09-07 14:23:09 -0700191o "ci" is the number of RCU callbacks that have been invoked for
192 this CPU. Note that ci+ql is the number of callbacks that have
193 been registered in absence of CPU-hotplug activity.
194
195o "co" is the number of RCU callbacks that have been orphaned due to
Paul E. McKenney2d999e02010-10-20 12:06:18 -0700196 this CPU going offline. These orphaned callbacks have been moved
197 to an arbitrarily chosen online CPU.
Paul E. McKenney269dcc12010-09-07 14:23:09 -0700198
199o "ca" is the number of RCU callbacks that have been adopted due to
200 other CPUs going offline. Note that ci+co-ca+ql is the number of
201 RCU callbacks registered on this CPU.
202
Paul E. McKenney6fd9b3a2009-04-13 21:31:18 -0700203There is also an rcu/rcudata.csv file with the same information in
204comma-separated-variable spreadsheet format.
205
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100206
207The output of "cat rcu/rcugp" looks as follows:
208
Paul E. McKenneyd6714c22009-08-22 13:56:46 -0700209rcu_sched: completed=33062 gpnum=33063
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100210rcu_bh: completed=464 gpnum=464
211
Paul E. McKenneybd58b432009-10-14 10:15:54 -0700212Again, this output is for both "rcu_sched" and "rcu_bh". Note that
213kernels built with CONFIG_TREE_PREEMPT_RCU will have an additional
214"rcu_preempt" line. The fields are taken from the rcu_state structure,
215and are as follows:
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100216
217o "completed" is the number of grace periods that have completed.
218 It is comparable to the "c" field from rcu/rcudata in that a
219 CPU whose "c" field matches the value of "completed" is aware
220 that the corresponding RCU grace period has completed.
221
222o "gpnum" is the number of grace periods that have started. It is
223 comparable to the "g" field from rcu/rcudata in that a CPU
224 whose "g" field matches the value of "gpnum" is aware that the
225 corresponding RCU grace period has started.
226
227 If these two fields are equal (as they are for "rcu_bh" above),
228 then there is no grace period in progress, in other words, RCU
229 is idle. On the other hand, if the two fields differ (as they
Paul E. McKenneybd58b432009-10-14 10:15:54 -0700230 do for "rcu_sched" above), then an RCU grace period is in progress.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100231
232
233The output of "cat rcu/rcuhier" looks as follows, with very long lines:
234
Paul E. McKenney2d999e02010-10-20 12:06:18 -0700235c=6902 g=6903 s=2 jfq=3 j=72c7 nfqs=13142/nfqsng=0(13142) fqlh=6
Paul E. McKenney12f5f522010-11-29 21:56:39 -08002361/1 ..>. 0:127 ^0
2373/3 ..>. 0:35 ^0 0/0 ..>. 36:71 ^1 0/0 ..>. 72:107 ^2 0/0 ..>. 108:127 ^3
2383/3f ..>. 0:5 ^0 2/3 ..>. 6:11 ^1 0/0 ..>. 12:17 ^2 0/0 ..>. 18:23 ^3 0/0 ..>. 24:29 ^4 0/0 ..>. 30:35 ^5 0/0 ..>. 36:41 ^0 0/0 ..>. 42:47 ^1 0/0 ..>. 48:53 ^2 0/0 ..>. 54:59 ^3 0/0 ..>. 60:65 ^4 0/0 ..>. 66:71 ^5 0/0 ..>. 72:77 ^0 0/0 ..>. 78:83 ^1 0/0 ..>. 84:89 ^2 0/0 ..>. 90:95 ^3 0/0 ..>. 96:101 ^4 0/0 ..>. 102:107 ^5 0/0 ..>. 108:113 ^0 0/0 ..>. 114:119 ^1 0/0 ..>. 120:125 ^2 0/0 ..>. 126:127 ^3
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100239rcu_bh:
Paul E. McKenney2d999e02010-10-20 12:06:18 -0700240c=-226 g=-226 s=1 jfq=-5701 j=72c7 nfqs=88/nfqsng=0(88) fqlh=0
Paul E. McKenney12f5f522010-11-29 21:56:39 -08002410/1 ..>. 0:127 ^0
2420/3 ..>. 0:35 ^0 0/0 ..>. 36:71 ^1 0/0 ..>. 72:107 ^2 0/0 ..>. 108:127 ^3
2430/3f ..>. 0:5 ^0 0/3 ..>. 6:11 ^1 0/0 ..>. 12:17 ^2 0/0 ..>. 18:23 ^3 0/0 ..>. 24:29 ^4 0/0 ..>. 30:35 ^5 0/0 ..>. 36:41 ^0 0/0 ..>. 42:47 ^1 0/0 ..>. 48:53 ^2 0/0 ..>. 54:59 ^3 0/0 ..>. 60:65 ^4 0/0 ..>. 66:71 ^5 0/0 ..>. 72:77 ^0 0/0 ..>. 78:83 ^1 0/0 ..>. 84:89 ^2 0/0 ..>. 90:95 ^3 0/0 ..>. 96:101 ^4 0/0 ..>. 102:107 ^5 0/0 ..>. 108:113 ^0 0/0 ..>. 114:119 ^1 0/0 ..>. 120:125 ^2 0/0 ..>. 126:127 ^3
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100244
Paul E. McKenneybd58b432009-10-14 10:15:54 -0700245This is once again split into "rcu_sched" and "rcu_bh" portions,
246and CONFIG_TREE_PREEMPT_RCU kernels will again have an additional
247"rcu_preempt" section. The fields are as follows:
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100248
249o "c" is exactly the same as "completed" under rcu/rcugp.
250
251o "g" is exactly the same as "gpnum" under rcu/rcugp.
252
253o "s" is the "signaled" state that drives force_quiescent_state()'s
254 state machine.
255
256o "jfq" is the number of jiffies remaining for this grace period
257 before force_quiescent_state() is invoked to help push things
Paul E. McKenney269dcc12010-09-07 14:23:09 -0700258 along. Note that CPUs in dyntick-idle mode throughout the grace
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100259 period will not report on their own, but rather must be check by
260 some other CPU via force_quiescent_state().
261
262o "j" is the low-order four hex digits of the jiffies counter.
263 Yes, Paul did run into a number of problems that turned out to
264 be due to the jiffies counter no longer counting. Why do you ask?
265
266o "nfqs" is the number of calls to force_quiescent_state() since
267 boot.
268
269o "nfqsng" is the number of useless calls to force_quiescent_state(),
270 where there wasn't actually a grace period active. This can
271 happen due to races. The number in parentheses is the difference
272 between "nfqs" and "nfqsng", or the number of times that
273 force_quiescent_state() actually did some real work.
274
275o "fqlh" is the number of calls to force_quiescent_state() that
276 exited immediately (without even being counted in nfqs above)
277 due to contention on ->fqslock.
278
279o Each element of the form "1/1 0:127 ^0" represents one struct
280 rcu_node. Each line represents one level of the hierarchy, from
281 root to leaves. It is best to think of the rcu_data structures
282 as forming yet another level after the leaves. Note that there
283 might be either one, two, or three levels of rcu_node structures,
284 depending on the relationship between CONFIG_RCU_FANOUT and
285 CONFIG_NR_CPUS.
Paul E. McKenney0edf1a62009-10-14 10:15:59 -0700286
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100287 o The numbers separated by the "/" are the qsmask followed
288 by the qsmaskinit. The qsmask will have one bit
289 set for each entity in the next lower level that
290 has not yet checked in for the current grace period.
291 The qsmaskinit will have one bit for each entity that is
292 currently expected to check in during each grace period.
293 The value of qsmaskinit is assigned to that of qsmask
294 at the beginning of each grace period.
295
Paul E. McKenneybd58b432009-10-14 10:15:54 -0700296 For example, for "rcu_sched", the qsmask of the first
297 entry of the lowest level is 0x14, meaning that we
298 are still waiting for CPUs 2 and 4 to check in for the
299 current grace period.
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100300
Paul E. McKenney0edf1a62009-10-14 10:15:59 -0700301 o The characters separated by the ">" indicate the state
Paul E. McKenney12f5f522010-11-29 21:56:39 -0800302 of the blocked-tasks lists. A "G" preceding the ">"
Paul E. McKenney0edf1a62009-10-14 10:15:59 -0700303 indicates that at least one task blocked in an RCU
304 read-side critical section blocks the current grace
Paul E. McKenney12f5f522010-11-29 21:56:39 -0800305 period, while a "E" preceding the ">" indicates that
306 at least one task blocked in an RCU read-side critical
307 section blocks the current expedited grace period.
308 A "T" character following the ">" indicates that at
309 least one task is blocked within an RCU read-side
310 critical section, regardless of whether any current
311 grace period (expedited or normal) is inconvenienced.
312 A "." character appears if the corresponding condition
313 does not hold, so that "..>." indicates that no tasks
314 are blocked. In contrast, "GE>T" indicates maximal
315 inconvenience from blocked tasks.
Paul E. McKenney0edf1a62009-10-14 10:15:59 -0700316
Paul E. McKenney64db4cf2008-12-18 21:55:32 +0100317 o The numbers separated by the ":" are the range of CPUs
318 served by this struct rcu_node. This can be helpful
319 in working out how the hierarchy is wired together.
320
321 For example, the first entry at the lowest level shows
322 "0:5", indicating that it covers CPUs 0 through 5.
323
324 o The number after the "^" indicates the bit in the
325 next higher level rcu_node structure that this
326 rcu_node structure corresponds to.
327
328 For example, the first entry at the lowest level shows
329 "^0", indicating that it corresponds to bit zero in
330 the first entry at the middle level.
Paul E. McKenney6fd9b3a2009-04-13 21:31:18 -0700331
332
333The output of "cat rcu/rcu_pending" looks as follows:
334
Paul E. McKenneyd6714c22009-08-22 13:56:46 -0700335rcu_sched:
Paul E. McKenney4605c012012-06-26 14:00:48 -0700336 0 np=255892 qsp=53936 rpq=85 cbr=0 cng=14417 gpc=10033 gps=24320 nn=146741
337 1 np=261224 qsp=54638 rpq=33 cbr=0 cng=25723 gpc=16310 gps=2849 nn=155792
338 2 np=237496 qsp=49664 rpq=23 cbr=0 cng=2762 gpc=45478 gps=1762 nn=136629
339 3 np=236249 qsp=48766 rpq=98 cbr=0 cng=286 gpc=48049 gps=1218 nn=137723
340 4 np=221310 qsp=46850 rpq=7 cbr=0 cng=26 gpc=43161 gps=4634 nn=123110
341 5 np=237332 qsp=48449 rpq=9 cbr=0 cng=54 gpc=47920 gps=3252 nn=137456
342 6 np=219995 qsp=46718 rpq=12 cbr=0 cng=50 gpc=42098 gps=6093 nn=120834
343 7 np=249893 qsp=49390 rpq=42 cbr=0 cng=72 gpc=38400 gps=17102 nn=144888
Paul E. McKenney6fd9b3a2009-04-13 21:31:18 -0700344rcu_bh:
Paul E. McKenney4605c012012-06-26 14:00:48 -0700345 0 np=146741 qsp=1419 rpq=6 cbr=0 cng=6 gpc=0 gps=0 nn=145314
346 1 np=155792 qsp=12597 rpq=3 cbr=0 cng=0 gpc=4 gps=8 nn=143180
347 2 np=136629 qsp=18680 rpq=1 cbr=0 cng=0 gpc=7 gps=6 nn=117936
348 3 np=137723 qsp=2843 rpq=0 cbr=0 cng=0 gpc=10 gps=7 nn=134863
349 4 np=123110 qsp=12433 rpq=0 cbr=0 cng=0 gpc=4 gps=2 nn=110671
350 5 np=137456 qsp=4210 rpq=1 cbr=0 cng=0 gpc=6 gps=5 nn=133235
351 6 np=120834 qsp=9902 rpq=2 cbr=0 cng=0 gpc=6 gps=3 nn=110921
352 7 np=144888 qsp=26336 rpq=0 cbr=0 cng=0 gpc=8 gps=2 nn=118542
Paul E. McKenney6fd9b3a2009-04-13 21:31:18 -0700353
Paul E. McKenneybd58b432009-10-14 10:15:54 -0700354As always, this is once again split into "rcu_sched" and "rcu_bh"
355portions, with CONFIG_TREE_PREEMPT_RCU kernels having an additional
356"rcu_preempt" section. The fields are as follows:
Paul E. McKenney6fd9b3a2009-04-13 21:31:18 -0700357
358o "np" is the number of times that __rcu_pending() has been invoked
359 for the corresponding flavor of RCU.
360
361o "qsp" is the number of times that the RCU was waiting for a
362 quiescent state from this CPU.
363
Paul E. McKenneyd21670a2010-04-14 17:39:26 -0700364o "rpq" is the number of times that the CPU had passed through
365 a quiescent state, but not yet reported it to RCU.
366
Paul E. McKenney6fd9b3a2009-04-13 21:31:18 -0700367o "cbr" is the number of times that this CPU had RCU callbacks
368 that had passed through a grace period, and were thus ready
369 to be invoked.
370
371o "cng" is the number of times that this CPU needed another
372 grace period while RCU was idle.
373
374o "gpc" is the number of times that an old grace period had
375 completed, but this CPU was not yet aware of it.
376
377o "gps" is the number of times that a new grace period had started,
378 but this CPU was not yet aware of it.
379
Paul E. McKenney6fd9b3a2009-04-13 21:31:18 -0700380o "nn" is the number of times that this CPU needed nothing. Alert
381 readers will note that the rcu "nn" number for a given CPU very
382 closely matches the rcu_bh "np" number for that same CPU. This
383 is due to short-circuit evaluation in rcu_pending().
Paul E. McKenney8e79e1f2010-11-04 14:31:19 -0700384
385
Paul E. McKenney90e6ac32011-04-06 15:20:47 -0700386The output of "cat rcu/rcutorture" looks as follows:
387
388rcutorture test sequence: 0 (test in progress)
389rcutorture update version number: 615
390
391The first line shows the number of rcutorture tests that have completed
392since boot. If a test is currently running, the "(test in progress)"
393string will appear as shown above. The second line shows the number of
394update cycles that the current test has started, or zero if there is
395no test in progress.
396
397
398The output of "cat rcu/rcuboost" looks as follows:
399
4000:5 tasks=.... kt=W ntb=0 neb=0 nnb=0 j=2f95 bt=300f
401 balk: nt=0 egt=989 bt=0 nb=0 ny=0 nos=16
4026:7 tasks=.... kt=W ntb=0 neb=0 nnb=0 j=2f95 bt=300f
403 balk: nt=0 egt=225 bt=0 nb=0 ny=0 nos=6
404
405This information is output only for rcu_preempt. Each two-line entry
406corresponds to a leaf rcu_node strcuture. The fields are as follows:
407
408o "n:m" is the CPU-number range for the corresponding two-line
409 entry. In the sample output above, the first entry covers
410 CPUs zero through five and the second entry covers CPUs 6
411 and 7.
412
413o "tasks=TNEB" gives the state of the various segments of the
414 rnp->blocked_tasks list:
415
416 "T" This indicates that there are some tasks that blocked
417 while running on one of the corresponding CPUs while
418 in an RCU read-side critical section.
419
420 "N" This indicates that some of the blocked tasks are preventing
421 the current normal (non-expedited) grace period from
422 completing.
423
424 "E" This indicates that some of the blocked tasks are preventing
425 the current expedited grace period from completing.
426
427 "B" This indicates that some of the blocked tasks are in
428 need of RCU priority boosting.
429
430 Each character is replaced with "." if the corresponding
431 condition does not hold.
432
433o "kt" is the state of the RCU priority-boosting kernel
434 thread associated with the corresponding rcu_node structure.
435 The state can be one of the following:
436
437 "S" The kernel thread is stopped, in other words, all
438 CPUs corresponding to this rcu_node structure are
439 offline.
440
441 "R" The kernel thread is running.
442
443 "W" The kernel thread is waiting because there is no work
444 for it to do.
445
446 "Y" The kernel thread is yielding to avoid hogging CPU.
447
448 "?" Unknown value, indicates a bug.
449
450o "ntb" is the number of tasks boosted.
451
452o "neb" is the number of tasks boosted in order to complete an
453 expedited grace period.
454
455o "nnb" is the number of tasks boosted in order to complete a
456 normal (non-expedited) grace period. When boosting a task
457 that was blocking both an expedited and a normal grace period,
458 it is counted against the expedited total above.
459
460o "j" is the low-order 16 bits of the jiffies counter in
461 hexadecimal.
462
463o "bt" is the low-order 16 bits of the value that the jiffies
464 counter will have when we next start boosting, assuming that
465 the current grace period does not end beforehand. This is
466 also in hexadecimal.
467
468o "balk: nt" counts the number of times we didn't boost (in
469 other words, we balked) even though it was time to boost because
470 there were no blocked tasks to boost. This situation occurs
471 when there is one blocked task on one rcu_node structure and
472 none on some other rcu_node structure.
473
474o "egt" counts the number of times we balked because although
475 there were blocked tasks, none of them were blocking the
476 current grace period, whether expedited or otherwise.
477
478o "bt" counts the number of times we balked because boosting
479 had already been initiated for the current grace period.
480
481o "nb" counts the number of times we balked because there
482 was at least one task blocking the current non-expedited grace
483 period that never had blocked. If it is already running, it
484 just won't help to boost its priority!
485
486o "ny" counts the number of times we balked because it was
487 not yet time to start boosting.
488
489o "nos" counts the number of times we balked for other
490 reasons, e.g., the grace period ended first.
491
492
Paul E. McKenney8e79e1f2010-11-04 14:31:19 -0700493CONFIG_TINY_RCU and CONFIG_TINY_PREEMPT_RCU debugfs Files and Formats
494
495These implementations of RCU provides a single debugfs file under the
496top-level directory RCU, namely rcu/rcudata, which displays fields in
497rcu_bh_ctrlblk, rcu_sched_ctrlblk and, for CONFIG_TINY_PREEMPT_RCU,
498rcu_preempt_ctrlblk.
499
500The output of "cat rcu/rcudata" is as follows:
501
502rcu_preempt: qlen=24 gp=1097669 g197/p197/c197 tasks=...
503 ttb=. btg=no ntb=184 neb=0 nnb=183 j=01f7 bt=0274
504 normal balk: nt=1097669 gt=0 bt=371 b=0 ny=25073378 nos=0
505 exp balk: bt=0 nos=0
506rcu_sched: qlen: 0
507rcu_bh: qlen: 0
508
509This is split into rcu_preempt, rcu_sched, and rcu_bh sections, with the
510rcu_preempt section appearing only in CONFIG_TINY_PREEMPT_RCU builds.
511The last three lines of the rcu_preempt section appear only in
512CONFIG_RCU_BOOST kernel builds. The fields are as follows:
513
514o "qlen" is the number of RCU callbacks currently waiting either
515 for an RCU grace period or waiting to be invoked. This is the
516 only field present for rcu_sched and rcu_bh, due to the
517 short-circuiting of grace period in those two cases.
518
519o "gp" is the number of grace periods that have completed.
520
521o "g197/p197/c197" displays the grace-period state, with the
522 "g" number being the number of grace periods that have started
523 (mod 256), the "p" number being the number of grace periods
524 that the CPU has responded to (also mod 256), and the "c"
525 number being the number of grace periods that have completed
526 (once again mode 256).
527
528 Why have both "gp" and "g"? Because the data flowing into
529 "gp" is only present in a CONFIG_RCU_TRACE kernel.
530
531o "tasks" is a set of bits. The first bit is "T" if there are
532 currently tasks that have recently blocked within an RCU
533 read-side critical section, the second bit is "N" if any of the
534 aforementioned tasks are blocking the current RCU grace period,
535 and the third bit is "E" if any of the aforementioned tasks are
536 blocking the current expedited grace period. Each bit is "."
537 if the corresponding condition does not hold.
538
539o "ttb" is a single bit. It is "B" if any of the blocked tasks
540 need to be priority boosted and "." otherwise.
541
542o "btg" indicates whether boosting has been carried out during
543 the current grace period, with "exp" indicating that boosting
544 is in progress for an expedited grace period, "no" indicating
545 that boosting has not yet started for a normal grace period,
546 "begun" indicating that boosting has bebug for a normal grace
547 period, and "done" indicating that boosting has completed for
548 a normal grace period.
549
550o "ntb" is the total number of tasks subjected to RCU priority boosting
551 periods since boot.
552
553o "neb" is the number of expedited grace periods that have had
554 to resort to RCU priority boosting since boot.
555
556o "nnb" is the number of normal grace periods that have had
557 to resort to RCU priority boosting since boot.
558
Paul E. McKenney90e6ac32011-04-06 15:20:47 -0700559o "j" is the low-order 16 bits of the jiffies counter in hexadecimal.
Paul E. McKenney8e79e1f2010-11-04 14:31:19 -0700560
Paul E. McKenney90e6ac32011-04-06 15:20:47 -0700561o "bt" is the low-order 16 bits of the value that the jiffies counter
Paul E. McKenney8e79e1f2010-11-04 14:31:19 -0700562 will have at the next time that boosting is scheduled to begin.
563
564o In the line beginning with "normal balk", the fields are as follows:
565
566 o "nt" is the number of times that the system balked from
567 boosting because there were no blocked tasks to boost.
568 Note that the system will balk from boosting even if the
569 grace period is overdue when the currently running task
570 is looping within an RCU read-side critical section.
571 There is no point in boosting in this case, because
572 boosting a running task won't make it run any faster.
573
574 o "gt" is the number of times that the system balked
575 from boosting because, although there were blocked tasks,
576 none of them were preventing the current grace period
577 from completing.
578
579 o "bt" is the number of times that the system balked
580 from boosting because boosting was already in progress.
581
582 o "b" is the number of times that the system balked from
583 boosting because boosting had already completed for
584 the grace period in question.
585
586 o "ny" is the number of times that the system balked from
587 boosting because it was not yet time to start boosting
588 the grace period in question.
589
590 o "nos" is the number of times that the system balked from
591 boosting for inexplicable ("not otherwise specified")
592 reasons. This can actually happen due to races involving
593 increments of the jiffies counter.
594
595o In the line beginning with "exp balk", the fields are as follows:
596
597 o "bt" is the number of times that the system balked from
598 boosting because there were no blocked tasks to boost.
599
600 o "nos" is the number of times that the system balked from
601 boosting for inexplicable ("not otherwise specified")
602 reasons.