trace.txt 27 KB

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