Commit | Line | Data |
---|---|---|
64db4cff PM |
1 | CONFIG_RCU_TRACE debugfs Files and Formats |
2 | ||
3 | ||
8e79e1f9 PM |
4 | The rcutree and rcutiny implementations of RCU provide debugfs trace |
5 | output that summarizes counters and state. This information is useful for | |
6 | debugging RCU itself, and can sometimes also help to debug abuses of RCU. | |
7 | The following sections describe the debugfs files and formats, first | |
8 | for rcutree and next for rcutiny. | |
64db4cff PM |
9 | |
10 | ||
8e79e1f9 | 11 | CONFIG_TREE_RCU and CONFIG_TREE_PREEMPT_RCU debugfs Files and Formats |
64db4cff | 12 | |
8e79e1f9 | 13 | These implementations of RCU provides five debugfs files under the |
64db4cff | 14 | top-level directory RCU: rcu/rcudata (which displays fields in struct |
8e79e1f9 PM |
15 | rcu_data), rcu/rcudata.csv (which is a .csv spreadsheet version of |
16 | rcu/rcudata), rcu/rcugp (which displays grace-period counters), | |
17 | rcu/rcuhier (which displays the struct rcu_node hierarchy), and | |
18 | rcu/rcu_pending (which displays counts of the reasons that the | |
19 | rcu_pending() function decided that there was core RCU work to do). | |
64db4cff PM |
20 | |
21 | The output of "cat rcu/rcudata" looks as follows: | |
22 | ||
d6714c22 | 23 | rcu_sched: |
2fa218d8 PM |
24 | 0!c=423090 g=423091 pq=1 pqc=423090 qp=1 dt=86475/1/0 df=16319 of=163 ri=1519 ql=0 b=10 ci=1460693 co=1648 ca=6448 |
25 | 1!c=423329 g=423330 pq=1 pqc=423329 qp=1 dt=90875/1/0 df=16231 of=157 ri=1249 ql=0 b=10 ci=1459002 co=1614 ca=3310 | |
26 | 2!c=423370 g=423371 pq=1 pqc=423370 qp=1 dt=69661/1/0 df=16125 of=163 ri=1469 ql=0 b=10 ci=1610701 co=2015 ca=2378 | |
27 | 3!c=422967 g=422968 pq=1 pqc=422967 qp=1 dt=70349/1/0 df=12528 of=163 ri=1450 ql=0 b=10 ci=1427543 co=1430 ca=897 | |
28 | 4!c=423196 g=423197 pq=1 pqc=423196 qp=0 dt=38935/1/0 df=10959 of=177 ri=1657 ql=0 b=10 ci=1562249 co=1896 ca=533 | |
29 | 5!c=422950 g=422951 pq=1 pqc=422950 qp=0 dt=25127/1/0 df=5895 of=167 ri=1549 ql=0 b=10 ci=1777260 co=2137 ca=274 | |
30 | 6!c=423396 g=423397 pq=1 pqc=423396 qp=1 dt=22639/1/0 df=4590 of=149 ri=1572 ql=0 b=10 ci=1471186 co=1530 ca=243 | |
31 | 7 c=460203 g=460203 pq=1 pqc=460202 qp=0 dt=937087/1/0 df=3298 of=149 ri=1584 ql=6 b=10 ci=4026154 co=1948 ca=135 | |
64db4cff | 32 | rcu_bh: |
2fa218d8 PM |
33 | 0!c=18446744073709551494 g=18446744073709551494 pq=0 pqc=18446744073709551493 qp=1 dt=86475/1/0 df=11 of=0 ri=0 ql=0 b=10 ci=112 co=0 ca=0 |
34 | 1!c=18446744073709551496 g=18446744073709551496 pq=1 pqc=18446744073709551495 qp=0 dt=90875/1/0 df=15 of=0 ri=0 ql=0 b=10 ci=143 co=0 ca=0 | |
35 | 2!c=18446744073709551496 g=18446744073709551496 pq=1 pqc=18446744073709551495 qp=0 dt=69661/1/0 df=21 of=0 ri=1 ql=0 b=10 ci=88 co=0 ca=0 | |
36 | 3!c=18446744073709551494 g=18446744073709551494 pq=1 pqc=18446744073709551493 qp=0 dt=70349/1/0 df=13 of=0 ri=0 ql=0 b=10 ci=100 co=0 ca=0 | |
37 | 4!c=18446744073709551494 g=18446744073709551494 pq=0 pqc=18446744073709551493 qp=1 dt=38935/1/0 df=17 of=0 ri=0 ql=0 b=10 ci=36 co=0 ca=0 | |
38 | 5!c=18446744073709551494 g=18446744073709551494 pq=0 pqc=18446744073709551493 qp=1 dt=25127/1/0 df=7 of=0 ri=0 ql=0 b=10 ci=32 co=0 ca=0 | |
39 | 6!c=18446744073709551496 g=18446744073709551496 pq=1 pqc=18446744073709551495 qp=0 dt=22639/1/0 df=9 of=0 ri=0 ql=0 b=10 ci=44 co=0 ca=0 | |
40 | 7 c=182 g=182 pq=1 pqc=181 qp=0 dt=937087/1/0 df=14 of=0 ri=1 ql=0 b=10 ci=627 co=0 ca=0 | |
64db4cff | 41 | |
bd58b430 PM |
42 | The first section lists the rcu_data structures for rcu_sched, the second |
43 | for rcu_bh. Note that CONFIG_TREE_PREEMPT_RCU kernels will have an | |
44 | additional section for rcu_preempt. Each section has one line per CPU, | |
45 | or eight for this 8-CPU system. The fields are as follows: | |
64db4cff PM |
46 | |
47 | o The number at the beginning of each line is the CPU number. | |
48 | CPUs numbers followed by an exclamation mark are offline, | |
49 | but have been online at least once since boot. There will be | |
50 | no output for CPUs that have never been online, which can be | |
51 | a good thing in the surprisingly common case where NR_CPUS is | |
52 | substantially larger than the number of actual CPUs. | |
53 | ||
54 | o "c" is the count of grace periods that this CPU believes have | |
2fa218d8 PM |
55 | completed. Offlined CPUs and CPUs in dynticks idle mode may |
56 | lag quite a ways behind, for example, CPU 6 under "rcu_sched" | |
57 | above, which has been offline through not quite 40,000 RCU grace | |
58 | periods. It is not unusual to see CPUs lagging by thousands of | |
59 | grace periods. | |
64db4cff PM |
60 | |
61 | o "g" is the count of grace periods that this CPU believes have | |
2fa218d8 PM |
62 | started. Again, offlined CPUs and CPUs in dynticks idle mode |
63 | may lag behind. If the "c" and "g" values are equal, this CPU | |
64 | has already reported a quiescent state for the last RCU grace | |
65 | period that it is aware of, otherwise, the CPU believes that it | |
66 | owes RCU a quiescent state. | |
64db4cff PM |
67 | |
68 | o "pq" indicates that this CPU has passed through a quiescent state | |
69 | for the current grace period. It is possible for "pq" to be | |
70 | "1" and "c" different than "g", which indicates that although | |
71 | the CPU has passed through a quiescent state, either (1) this | |
72 | CPU has not yet reported that fact, (2) some other CPU has not | |
73 | yet reported for this grace period, or (3) both. | |
74 | ||
75 | o "pqc" indicates which grace period the last-observed quiescent | |
76 | state for this CPU corresponds to. This is important for handling | |
77 | the race between CPU 0 reporting an extended dynticks-idle | |
78 | quiescent state for CPU 1 and CPU 1 suddenly waking up and | |
79 | reporting its own quiescent state. If CPU 1 was the last CPU | |
80 | for the current grace period, then the CPU that loses this race | |
81 | will attempt to incorrectly mark CPU 1 as having checked in for | |
82 | the next grace period! | |
83 | ||
84 | o "qp" indicates that RCU still expects a quiescent state from | |
2fa218d8 PM |
85 | this CPU. Offlined CPUs and CPUs in dyntick idle mode might |
86 | well have qp=1, which is OK: RCU is still ignoring them. | |
64db4cff | 87 | |
64db4cff PM |
88 | o "dt" is the current value of the dyntick counter that is incremented |
89 | when entering or leaving dynticks idle state, either by the | |
2fa218d8 PM |
90 | scheduler or by irq. This number is even if the CPU is in |
91 | dyntick idle mode and odd otherwise. The number after the first | |
92 | "/" is the interrupt nesting depth when in dyntick-idle state, | |
93 | or one greater than the interrupt-nesting depth otherwise. | |
94 | The number after the second "/" is the NMI nesting depth. | |
64db4cff PM |
95 | |
96 | This field is displayed only for CONFIG_NO_HZ kernels. | |
97 | ||
98 | o "df" is the number of times that some other CPU has forced a | |
99 | quiescent state on behalf of this CPU due to this CPU being in | |
100 | dynticks-idle state. | |
101 | ||
102 | This field is displayed only for CONFIG_NO_HZ kernels. | |
103 | ||
104 | o "of" is the number of times that some other CPU has forced a | |
105 | quiescent state on behalf of this CPU due to this CPU being | |
2fa218d8 | 106 | offline. In a perfect world, this might never happen, but it |
64db4cff PM |
107 | turns out that offlining and onlining a CPU can take several grace |
108 | periods, and so there is likely to be an extended period of time | |
109 | when RCU believes that the CPU is online when it really is not. | |
110 | Please note that erring in the other direction (RCU believing a | |
111 | CPU is offline when it is really alive and kicking) is a fatal | |
112 | error, so it makes sense to err conservatively. | |
113 | ||
114 | o "ri" is the number of times that RCU has seen fit to send a | |
115 | reschedule IPI to this CPU in order to get it to report a | |
116 | quiescent state. | |
117 | ||
118 | o "ql" is the number of RCU callbacks currently residing on | |
119 | this CPU. This is the total number of callbacks, regardless | |
120 | of what state they are in (new, waiting for grace period to | |
121 | start, waiting for grace period to end, ready to invoke). | |
122 | ||
123 | o "b" is the batch limit for this CPU. If more than this number | |
124 | of RCU callbacks is ready to invoke, then the remainder will | |
125 | be deferred. | |
126 | ||
269dcc1c PM |
127 | o "ci" is the number of RCU callbacks that have been invoked for |
128 | this CPU. Note that ci+ql is the number of callbacks that have | |
129 | been registered in absence of CPU-hotplug activity. | |
130 | ||
131 | o "co" is the number of RCU callbacks that have been orphaned due to | |
2d999e03 PM |
132 | this CPU going offline. These orphaned callbacks have been moved |
133 | to an arbitrarily chosen online CPU. | |
269dcc1c PM |
134 | |
135 | o "ca" is the number of RCU callbacks that have been adopted due to | |
136 | other CPUs going offline. Note that ci+co-ca+ql is the number of | |
137 | RCU callbacks registered on this CPU. | |
138 | ||
6fd9b3a4 PM |
139 | There is also an rcu/rcudata.csv file with the same information in |
140 | comma-separated-variable spreadsheet format. | |
141 | ||
64db4cff PM |
142 | |
143 | The output of "cat rcu/rcugp" looks as follows: | |
144 | ||
d6714c22 | 145 | rcu_sched: completed=33062 gpnum=33063 |
64db4cff PM |
146 | rcu_bh: completed=464 gpnum=464 |
147 | ||
bd58b430 PM |
148 | Again, this output is for both "rcu_sched" and "rcu_bh". Note that |
149 | kernels built with CONFIG_TREE_PREEMPT_RCU will have an additional | |
150 | "rcu_preempt" line. The fields are taken from the rcu_state structure, | |
151 | and are as follows: | |
64db4cff PM |
152 | |
153 | o "completed" is the number of grace periods that have completed. | |
154 | It is comparable to the "c" field from rcu/rcudata in that a | |
155 | CPU whose "c" field matches the value of "completed" is aware | |
156 | that the corresponding RCU grace period has completed. | |
157 | ||
158 | o "gpnum" is the number of grace periods that have started. It is | |
159 | comparable to the "g" field from rcu/rcudata in that a CPU | |
160 | whose "g" field matches the value of "gpnum" is aware that the | |
161 | corresponding RCU grace period has started. | |
162 | ||
163 | If these two fields are equal (as they are for "rcu_bh" above), | |
164 | then there is no grace period in progress, in other words, RCU | |
165 | is idle. On the other hand, if the two fields differ (as they | |
bd58b430 | 166 | do for "rcu_sched" above), then an RCU grace period is in progress. |
64db4cff PM |
167 | |
168 | ||
169 | The output of "cat rcu/rcuhier" looks as follows, with very long lines: | |
170 | ||
2d999e03 | 171 | c=6902 g=6903 s=2 jfq=3 j=72c7 nfqs=13142/nfqsng=0(13142) fqlh=6 |
12f5f524 PM |
172 | 1/1 ..>. 0:127 ^0 |
173 | 3/3 ..>. 0:35 ^0 0/0 ..>. 36:71 ^1 0/0 ..>. 72:107 ^2 0/0 ..>. 108:127 ^3 | |
174 | 3/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 | |
64db4cff | 175 | rcu_bh: |
2d999e03 | 176 | c=-226 g=-226 s=1 jfq=-5701 j=72c7 nfqs=88/nfqsng=0(88) fqlh=0 |
12f5f524 PM |
177 | 0/1 ..>. 0:127 ^0 |
178 | 0/3 ..>. 0:35 ^0 0/0 ..>. 36:71 ^1 0/0 ..>. 72:107 ^2 0/0 ..>. 108:127 ^3 | |
179 | 0/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 | |
64db4cff | 180 | |
bd58b430 PM |
181 | This is once again split into "rcu_sched" and "rcu_bh" portions, |
182 | and CONFIG_TREE_PREEMPT_RCU kernels will again have an additional | |
183 | "rcu_preempt" section. The fields are as follows: | |
64db4cff PM |
184 | |
185 | o "c" is exactly the same as "completed" under rcu/rcugp. | |
186 | ||
187 | o "g" is exactly the same as "gpnum" under rcu/rcugp. | |
188 | ||
189 | o "s" is the "signaled" state that drives force_quiescent_state()'s | |
190 | state machine. | |
191 | ||
192 | o "jfq" is the number of jiffies remaining for this grace period | |
193 | before force_quiescent_state() is invoked to help push things | |
269dcc1c | 194 | along. Note that CPUs in dyntick-idle mode throughout the grace |
64db4cff PM |
195 | period will not report on their own, but rather must be check by |
196 | some other CPU via force_quiescent_state(). | |
197 | ||
198 | o "j" is the low-order four hex digits of the jiffies counter. | |
199 | Yes, Paul did run into a number of problems that turned out to | |
200 | be due to the jiffies counter no longer counting. Why do you ask? | |
201 | ||
202 | o "nfqs" is the number of calls to force_quiescent_state() since | |
203 | boot. | |
204 | ||
205 | o "nfqsng" is the number of useless calls to force_quiescent_state(), | |
206 | where there wasn't actually a grace period active. This can | |
207 | happen due to races. The number in parentheses is the difference | |
208 | between "nfqs" and "nfqsng", or the number of times that | |
209 | force_quiescent_state() actually did some real work. | |
210 | ||
211 | o "fqlh" is the number of calls to force_quiescent_state() that | |
212 | exited immediately (without even being counted in nfqs above) | |
213 | due to contention on ->fqslock. | |
214 | ||
215 | o Each element of the form "1/1 0:127 ^0" represents one struct | |
216 | rcu_node. Each line represents one level of the hierarchy, from | |
217 | root to leaves. It is best to think of the rcu_data structures | |
218 | as forming yet another level after the leaves. Note that there | |
219 | might be either one, two, or three levels of rcu_node structures, | |
220 | depending on the relationship between CONFIG_RCU_FANOUT and | |
221 | CONFIG_NR_CPUS. | |
0edf1a68 | 222 | |
64db4cff PM |
223 | o The numbers separated by the "/" are the qsmask followed |
224 | by the qsmaskinit. The qsmask will have one bit | |
225 | set for each entity in the next lower level that | |
226 | has not yet checked in for the current grace period. | |
227 | The qsmaskinit will have one bit for each entity that is | |
228 | currently expected to check in during each grace period. | |
229 | The value of qsmaskinit is assigned to that of qsmask | |
230 | at the beginning of each grace period. | |
231 | ||
bd58b430 PM |
232 | For example, for "rcu_sched", the qsmask of the first |
233 | entry of the lowest level is 0x14, meaning that we | |
234 | are still waiting for CPUs 2 and 4 to check in for the | |
235 | current grace period. | |
64db4cff | 236 | |
0edf1a68 | 237 | o The characters separated by the ">" indicate the state |
12f5f524 | 238 | of the blocked-tasks lists. A "G" preceding the ">" |
0edf1a68 PM |
239 | indicates that at least one task blocked in an RCU |
240 | read-side critical section blocks the current grace | |
12f5f524 PM |
241 | period, while a "E" preceding the ">" indicates that |
242 | at least one task blocked in an RCU read-side critical | |
243 | section blocks the current expedited grace period. | |
244 | A "T" character following the ">" indicates that at | |
245 | least one task is blocked within an RCU read-side | |
246 | critical section, regardless of whether any current | |
247 | grace period (expedited or normal) is inconvenienced. | |
248 | A "." character appears if the corresponding condition | |
249 | does not hold, so that "..>." indicates that no tasks | |
250 | are blocked. In contrast, "GE>T" indicates maximal | |
251 | inconvenience from blocked tasks. | |
0edf1a68 | 252 | |
64db4cff PM |
253 | o The numbers separated by the ":" are the range of CPUs |
254 | served by this struct rcu_node. This can be helpful | |
255 | in working out how the hierarchy is wired together. | |
256 | ||
257 | For example, the first entry at the lowest level shows | |
258 | "0:5", indicating that it covers CPUs 0 through 5. | |
259 | ||
260 | o The number after the "^" indicates the bit in the | |
261 | next higher level rcu_node structure that this | |
262 | rcu_node structure corresponds to. | |
263 | ||
264 | For example, the first entry at the lowest level shows | |
265 | "^0", indicating that it corresponds to bit zero in | |
266 | the first entry at the middle level. | |
6fd9b3a4 PM |
267 | |
268 | ||
269 | The output of "cat rcu/rcu_pending" looks as follows: | |
270 | ||
d6714c22 | 271 | rcu_sched: |
d21670ac PM |
272 | 0 np=255892 qsp=53936 rpq=85 cbr=0 cng=14417 gpc=10033 gps=24320 nf=6445 nn=146741 |
273 | 1 np=261224 qsp=54638 rpq=33 cbr=0 cng=25723 gpc=16310 gps=2849 nf=5912 nn=155792 | |
274 | 2 np=237496 qsp=49664 rpq=23 cbr=0 cng=2762 gpc=45478 gps=1762 nf=1201 nn=136629 | |
275 | 3 np=236249 qsp=48766 rpq=98 cbr=0 cng=286 gpc=48049 gps=1218 nf=207 nn=137723 | |
276 | 4 np=221310 qsp=46850 rpq=7 cbr=0 cng=26 gpc=43161 gps=4634 nf=3529 nn=123110 | |
277 | 5 np=237332 qsp=48449 rpq=9 cbr=0 cng=54 gpc=47920 gps=3252 nf=201 nn=137456 | |
278 | 6 np=219995 qsp=46718 rpq=12 cbr=0 cng=50 gpc=42098 gps=6093 nf=4202 nn=120834 | |
279 | 7 np=249893 qsp=49390 rpq=42 cbr=0 cng=72 gpc=38400 gps=17102 nf=41 nn=144888 | |
6fd9b3a4 | 280 | rcu_bh: |
d21670ac PM |
281 | 0 np=146741 qsp=1419 rpq=6 cbr=0 cng=6 gpc=0 gps=0 nf=2 nn=145314 |
282 | 1 np=155792 qsp=12597 rpq=3 cbr=0 cng=0 gpc=4 gps=8 nf=3 nn=143180 | |
283 | 2 np=136629 qsp=18680 rpq=1 cbr=0 cng=0 gpc=7 gps=6 nf=0 nn=117936 | |
284 | 3 np=137723 qsp=2843 rpq=0 cbr=0 cng=0 gpc=10 gps=7 nf=0 nn=134863 | |
285 | 4 np=123110 qsp=12433 rpq=0 cbr=0 cng=0 gpc=4 gps=2 nf=0 nn=110671 | |
286 | 5 np=137456 qsp=4210 rpq=1 cbr=0 cng=0 gpc=6 gps=5 nf=0 nn=133235 | |
287 | 6 np=120834 qsp=9902 rpq=2 cbr=0 cng=0 gpc=6 gps=3 nf=2 nn=110921 | |
288 | 7 np=144888 qsp=26336 rpq=0 cbr=0 cng=0 gpc=8 gps=2 nf=0 nn=118542 | |
6fd9b3a4 | 289 | |
bd58b430 PM |
290 | As always, this is once again split into "rcu_sched" and "rcu_bh" |
291 | portions, with CONFIG_TREE_PREEMPT_RCU kernels having an additional | |
292 | "rcu_preempt" section. The fields are as follows: | |
6fd9b3a4 PM |
293 | |
294 | o "np" is the number of times that __rcu_pending() has been invoked | |
295 | for the corresponding flavor of RCU. | |
296 | ||
297 | o "qsp" is the number of times that the RCU was waiting for a | |
298 | quiescent state from this CPU. | |
299 | ||
d21670ac PM |
300 | o "rpq" is the number of times that the CPU had passed through |
301 | a quiescent state, but not yet reported it to RCU. | |
302 | ||
6fd9b3a4 PM |
303 | o "cbr" is the number of times that this CPU had RCU callbacks |
304 | that had passed through a grace period, and were thus ready | |
305 | to be invoked. | |
306 | ||
307 | o "cng" is the number of times that this CPU needed another | |
308 | grace period while RCU was idle. | |
309 | ||
310 | o "gpc" is the number of times that an old grace period had | |
311 | completed, but this CPU was not yet aware of it. | |
312 | ||
313 | o "gps" is the number of times that a new grace period had started, | |
314 | but this CPU was not yet aware of it. | |
315 | ||
316 | o "nf" is the number of times that this CPU suspected that the | |
317 | current grace period had run for too long, and thus needed to | |
318 | be forced. | |
319 | ||
320 | Please note that "forcing" consists of sending resched IPIs | |
321 | to holdout CPUs. If that CPU really still is in an old RCU | |
322 | read-side critical section, then we really do have to wait for it. | |
323 | The assumption behing "forcing" is that the CPU is not still in | |
324 | an old RCU read-side critical section, but has not yet responded | |
325 | for some other reason. | |
326 | ||
327 | o "nn" is the number of times that this CPU needed nothing. Alert | |
328 | readers will note that the rcu "nn" number for a given CPU very | |
329 | closely matches the rcu_bh "np" number for that same CPU. This | |
330 | is due to short-circuit evaluation in rcu_pending(). | |
8e79e1f9 PM |
331 | |
332 | ||
333 | CONFIG_TINY_RCU and CONFIG_TINY_PREEMPT_RCU debugfs Files and Formats | |
334 | ||
335 | These implementations of RCU provides a single debugfs file under the | |
336 | top-level directory RCU, namely rcu/rcudata, which displays fields in | |
337 | rcu_bh_ctrlblk, rcu_sched_ctrlblk and, for CONFIG_TINY_PREEMPT_RCU, | |
338 | rcu_preempt_ctrlblk. | |
339 | ||
340 | The output of "cat rcu/rcudata" is as follows: | |
341 | ||
342 | rcu_preempt: qlen=24 gp=1097669 g197/p197/c197 tasks=... | |
343 | ttb=. btg=no ntb=184 neb=0 nnb=183 j=01f7 bt=0274 | |
344 | normal balk: nt=1097669 gt=0 bt=371 b=0 ny=25073378 nos=0 | |
345 | exp balk: bt=0 nos=0 | |
346 | rcu_sched: qlen: 0 | |
347 | rcu_bh: qlen: 0 | |
348 | ||
349 | This is split into rcu_preempt, rcu_sched, and rcu_bh sections, with the | |
350 | rcu_preempt section appearing only in CONFIG_TINY_PREEMPT_RCU builds. | |
351 | The last three lines of the rcu_preempt section appear only in | |
352 | CONFIG_RCU_BOOST kernel builds. The fields are as follows: | |
353 | ||
354 | o "qlen" is the number of RCU callbacks currently waiting either | |
355 | for an RCU grace period or waiting to be invoked. This is the | |
356 | only field present for rcu_sched and rcu_bh, due to the | |
357 | short-circuiting of grace period in those two cases. | |
358 | ||
359 | o "gp" is the number of grace periods that have completed. | |
360 | ||
361 | o "g197/p197/c197" displays the grace-period state, with the | |
362 | "g" number being the number of grace periods that have started | |
363 | (mod 256), the "p" number being the number of grace periods | |
364 | that the CPU has responded to (also mod 256), and the "c" | |
365 | number being the number of grace periods that have completed | |
366 | (once again mode 256). | |
367 | ||
368 | Why have both "gp" and "g"? Because the data flowing into | |
369 | "gp" is only present in a CONFIG_RCU_TRACE kernel. | |
370 | ||
371 | o "tasks" is a set of bits. The first bit is "T" if there are | |
372 | currently tasks that have recently blocked within an RCU | |
373 | read-side critical section, the second bit is "N" if any of the | |
374 | aforementioned tasks are blocking the current RCU grace period, | |
375 | and the third bit is "E" if any of the aforementioned tasks are | |
376 | blocking the current expedited grace period. Each bit is "." | |
377 | if the corresponding condition does not hold. | |
378 | ||
379 | o "ttb" is a single bit. It is "B" if any of the blocked tasks | |
380 | need to be priority boosted and "." otherwise. | |
381 | ||
382 | o "btg" indicates whether boosting has been carried out during | |
383 | the current grace period, with "exp" indicating that boosting | |
384 | is in progress for an expedited grace period, "no" indicating | |
385 | that boosting has not yet started for a normal grace period, | |
386 | "begun" indicating that boosting has bebug for a normal grace | |
387 | period, and "done" indicating that boosting has completed for | |
388 | a normal grace period. | |
389 | ||
390 | o "ntb" is the total number of tasks subjected to RCU priority boosting | |
391 | periods since boot. | |
392 | ||
393 | o "neb" is the number of expedited grace periods that have had | |
394 | to resort to RCU priority boosting since boot. | |
395 | ||
396 | o "nnb" is the number of normal grace periods that have had | |
397 | to resort to RCU priority boosting since boot. | |
398 | ||
399 | o "j" is the low-order 12 bits of the jiffies counter in hexadecimal. | |
400 | ||
401 | o "bt" is the low-order 12 bits of the value that the jiffies counter | |
402 | will have at the next time that boosting is scheduled to begin. | |
403 | ||
404 | o In the line beginning with "normal balk", the fields are as follows: | |
405 | ||
406 | o "nt" is the number of times that the system balked from | |
407 | boosting because there were no blocked tasks to boost. | |
408 | Note that the system will balk from boosting even if the | |
409 | grace period is overdue when the currently running task | |
410 | is looping within an RCU read-side critical section. | |
411 | There is no point in boosting in this case, because | |
412 | boosting a running task won't make it run any faster. | |
413 | ||
414 | o "gt" is the number of times that the system balked | |
415 | from boosting because, although there were blocked tasks, | |
416 | none of them were preventing the current grace period | |
417 | from completing. | |
418 | ||
419 | o "bt" is the number of times that the system balked | |
420 | from boosting because boosting was already in progress. | |
421 | ||
422 | o "b" is the number of times that the system balked from | |
423 | boosting because boosting had already completed for | |
424 | the grace period in question. | |
425 | ||
426 | o "ny" is the number of times that the system balked from | |
427 | boosting because it was not yet time to start boosting | |
428 | the grace period in question. | |
429 | ||
430 | o "nos" is the number of times that the system balked from | |
431 | boosting for inexplicable ("not otherwise specified") | |
432 | reasons. This can actually happen due to races involving | |
433 | increments of the jiffies counter. | |
434 | ||
435 | o In the line beginning with "exp balk", the fields are as follows: | |
436 | ||
437 | o "bt" is the number of times that the system balked from | |
438 | boosting because there were no blocked tasks to boost. | |
439 | ||
440 | o "nos" is the number of times that the system balked from | |
441 | boosting for inexplicable ("not otherwise specified") | |
442 | reasons. |