diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2017-08-17 15:29:22 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2017-10-09 17:23:36 -0400 |
commit | d3cf5176d0b17610b7c7f1562e496ec401fe01f8 (patch) | |
tree | e72b6084e2bdbbfb4143b02654af025e20f0ec37 | |
parent | 3d916a443e97169a3d88765c4e0b07ac813f439f (diff) |
documentation: Update RCU CPU stall warning messages
The RCU CPU stall warnings have morphed significantly since the last
update, so this commit brings the documentation up to date.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r-- | Documentation/RCU/stallwarn.txt | 182 |
1 files changed, 105 insertions, 77 deletions
diff --git a/Documentation/RCU/stallwarn.txt b/Documentation/RCU/stallwarn.txt index 238acbd94917..a08f928c8557 100644 --- a/Documentation/RCU/stallwarn.txt +++ b/Documentation/RCU/stallwarn.txt | |||
@@ -171,67 +171,32 @@ Interpreting RCU's CPU Stall-Detector "Splats" | |||
171 | For non-RCU-tasks flavors of RCU, when a CPU detects that it is stalling, | 171 | For non-RCU-tasks flavors of RCU, when a CPU detects that it is stalling, |
172 | it will print a message similar to the following: | 172 | it will print a message similar to the following: |
173 | 173 | ||
174 | INFO: rcu_sched_state detected stall on CPU 5 (t=2500 jiffies) | 174 | INFO: rcu_sched detected stalls on CPUs/tasks: |
175 | 2-...: (3 GPs behind) idle=06c/0/0 softirq=1453/1455 fqs=0 | ||
176 | 16-...: (0 ticks this GP) idle=81c/0/0 softirq=764/764 fqs=0 | ||
177 | (detected by 32, t=2603 jiffies, g=7073, c=7072, q=625) | ||
175 | 178 | ||
176 | This message indicates that CPU 5 detected that it was causing a stall, | 179 | This message indicates that CPU 32 detected that CPUs 2 and 16 were both |
177 | and that the stall was affecting RCU-sched. This message will normally be | 180 | causing stalls, and that the stall was affecting RCU-sched. This message |
178 | followed by a stack dump of the offending CPU. On TREE_RCU kernel builds, | ||
179 | RCU and RCU-sched are implemented by the same underlying mechanism, | ||
180 | while on PREEMPT_RCU kernel builds, RCU is instead implemented | ||
181 | by rcu_preempt_state. | ||
182 | |||
183 | On the other hand, if the offending CPU fails to print out a stall-warning | ||
184 | message quickly enough, some other CPU will print a message similar to | ||
185 | the following: | ||
186 | |||
187 | INFO: rcu_bh_state detected stalls on CPUs/tasks: { 3 5 } (detected by 2, 2502 jiffies) | ||
188 | |||
189 | This message indicates that CPU 2 detected that CPUs 3 and 5 were both | ||
190 | causing stalls, and that the stall was affecting RCU-bh. This message | ||
191 | will normally be followed by stack dumps for each CPU. Please note that | 181 | will normally be followed by stack dumps for each CPU. Please note that |
192 | PREEMPT_RCU builds can be stalled by tasks as well as by CPUs, | 182 | PREEMPT_RCU builds can be stalled by tasks as well as by CPUs, and that |
193 | and that the tasks will be indicated by PID, for example, "P3421". | 183 | the tasks will be indicated by PID, for example, "P3421". It is even |
194 | It is even possible for a rcu_preempt_state stall to be caused by both | 184 | possible for a rcu_preempt_state stall to be caused by both CPUs -and- |
195 | CPUs -and- tasks, in which case the offending CPUs and tasks will all | 185 | tasks, in which case the offending CPUs and tasks will all be called |
196 | be called out in the list. | 186 | out in the list. |
197 | |||
198 | Finally, if the grace period ends just as the stall warning starts | ||
199 | printing, there will be a spurious stall-warning message: | ||
200 | |||
201 | INFO: rcu_bh_state detected stalls on CPUs/tasks: { } (detected by 4, 2502 jiffies) | ||
202 | |||
203 | This is rare, but does happen from time to time in real life. It is also | ||
204 | possible for a zero-jiffy stall to be flagged in this case, depending | ||
205 | on how the stall warning and the grace-period initialization happen to | ||
206 | interact. Please note that it is not possible to entirely eliminate this | ||
207 | sort of false positive without resorting to things like stop_machine(), | ||
208 | which is overkill for this sort of problem. | ||
209 | |||
210 | Recent kernels will print a long form of the stall-warning message: | ||
211 | |||
212 | INFO: rcu_preempt detected stall on CPU | ||
213 | 0: (63959 ticks this GP) idle=241/3fffffffffffffff/0 softirq=82/543 | ||
214 | (t=65000 jiffies) | ||
215 | |||
216 | In kernels with CONFIG_RCU_FAST_NO_HZ, more information is printed: | ||
217 | |||
218 | INFO: rcu_preempt detected stall on CPU | ||
219 | 0: (64628 ticks this GP) idle=dd5/3fffffffffffffff/0 softirq=82/543 last_accelerate: a345/d342 nonlazy_posted: 25 .D | ||
220 | (t=65000 jiffies) | ||
221 | 187 | ||
222 | The "(64628 ticks this GP)" indicates that this CPU has taken more | 188 | CPU 2's "(3 GPs behind)" indicates that this CPU has not interacted with |
223 | than 64,000 scheduling-clock interrupts during the current stalled | 189 | the RCU core for the past three grace periods. In contrast, CPU 16's "(0 |
224 | grace period. If the CPU was not yet aware of the current grace | 190 | ticks this GP)" indicates that this CPU has not taken any scheduling-clock |
225 | period (for example, if it was offline), then this part of the message | 191 | interrupts during the current stalled grace period. |
226 | indicates how many grace periods behind the CPU is. | ||
227 | 192 | ||
228 | The "idle=" portion of the message prints the dyntick-idle state. | 193 | The "idle=" portion of the message prints the dyntick-idle state. |
229 | The hex number before the first "/" is the low-order 12 bits of the | 194 | The hex number before the first "/" is the low-order 12 bits of the |
230 | dynticks counter, which will have an even-numbered value if the CPU is | 195 | dynticks counter, which will have an even-numbered value if the CPU |
231 | in dyntick-idle mode and an odd-numbered value otherwise. The hex | 196 | is in dyntick-idle mode and an odd-numbered value otherwise. The hex |
232 | number between the two "/"s is the value of the nesting, which will | 197 | number between the two "/"s is the value of the nesting, which will be |
233 | be a small positive number if in the idle loop and a very large positive | 198 | a small non-negative number if in the idle loop (as shown above) and a |
234 | number (as shown above) otherwise. | 199 | very large positive number otherwise. |
235 | 200 | ||
236 | The "softirq=" portion of the message tracks the number of RCU softirq | 201 | The "softirq=" portion of the message tracks the number of RCU softirq |
237 | handlers that the stalled CPU has executed. The number before the "/" | 202 | handlers that the stalled CPU has executed. The number before the "/" |
@@ -246,24 +211,72 @@ handlers are no longer able to execute on this CPU. This can happen if | |||
246 | the stalled CPU is spinning with interrupts are disabled, or, in -rt | 211 | the stalled CPU is spinning with interrupts are disabled, or, in -rt |
247 | kernels, if a high-priority process is starving RCU's softirq handler. | 212 | kernels, if a high-priority process is starving RCU's softirq handler. |
248 | 213 | ||
249 | For CONFIG_RCU_FAST_NO_HZ kernels, the "last_accelerate:" prints the | 214 | The "fps=" shows the number of force-quiescent-state idle/offline |
250 | low-order 16 bits (in hex) of the jiffies counter when this CPU last | 215 | detection passes that the grace-period kthread has made across this |
251 | invoked rcu_try_advance_all_cbs() from rcu_needs_cpu() or last invoked | 216 | CPU since the last time that this CPU noted the beginning of a grace |
252 | rcu_accelerate_cbs() from rcu_prepare_for_idle(). The "nonlazy_posted:" | 217 | period. |
253 | prints the number of non-lazy callbacks posted since the last call to | 218 | |
254 | rcu_needs_cpu(). Finally, an "L" indicates that there are currently | 219 | The "detected by" line indicates which CPU detected the stall (in this |
255 | no non-lazy callbacks ("." is printed otherwise, as shown above) and | 220 | case, CPU 32), how many jiffies have elapsed since the start of the |
256 | "D" indicates that dyntick-idle processing is enabled ("." is printed | 221 | grace period (in this case 2603), the number of the last grace period |
257 | otherwise, for example, if disabled via the "nohz=" kernel boot parameter). | 222 | to start and to complete (7073 and 7072, respectively), and an estimate |
223 | of the total number of RCU callbacks queued across all CPUs (625 in | ||
224 | this case). | ||
225 | |||
226 | In kernels with CONFIG_RCU_FAST_NO_HZ, more information is printed | ||
227 | for each CPU: | ||
228 | |||
229 | 0: (64628 ticks this GP) idle=dd5/3fffffffffffffff/0 softirq=82/543 last_accelerate: a345/d342 nonlazy_posted: 25 .D | ||
230 | |||
231 | The "last_accelerate:" prints the low-order 16 bits (in hex) of the | ||
232 | jiffies counter when this CPU last invoked rcu_try_advance_all_cbs() | ||
233 | from rcu_needs_cpu() or last invoked rcu_accelerate_cbs() from | ||
234 | rcu_prepare_for_idle(). The "nonlazy_posted:" prints the number | ||
235 | of non-lazy callbacks posted since the last call to rcu_needs_cpu(). | ||
236 | Finally, an "L" indicates that there are currently no non-lazy callbacks | ||
237 | ("." is printed otherwise, as shown above) and "D" indicates that | ||
238 | dyntick-idle processing is enabled ("." is printed otherwise, for example, | ||
239 | if disabled via the "nohz=" kernel boot parameter). | ||
240 | |||
241 | If the grace period ends just as the stall warning starts printing, | ||
242 | there will be a spurious stall-warning message, which will include | ||
243 | the following: | ||
244 | |||
245 | INFO: Stall ended before state dump start | ||
246 | |||
247 | This is rare, but does happen from time to time in real life. It is also | ||
248 | possible for a zero-jiffy stall to be flagged in this case, depending | ||
249 | on how the stall warning and the grace-period initialization happen to | ||
250 | interact. Please note that it is not possible to entirely eliminate this | ||
251 | sort of false positive without resorting to things like stop_machine(), | ||
252 | which is overkill for this sort of problem. | ||
253 | |||
254 | If all CPUs and tasks have passed through quiescent states, but the | ||
255 | grace period has nevertheless failed to end, the stall-warning splat | ||
256 | will include something like the following: | ||
257 | |||
258 | All QSes seen, last rcu_preempt kthread activity 23807 (4297905177-4297881370), jiffies_till_next_fqs=3, root ->qsmask 0x0 | ||
259 | |||
260 | The "23807" indicates that it has been more than 23 thousand jiffies | ||
261 | since the grace-period kthread ran. The "jiffies_till_next_fqs" | ||
262 | indicates how frequently that kthread should run, giving the number | ||
263 | of jiffies between force-quiescent-state scans, in this case three, | ||
264 | which is way less than 23807. Finally, the root rcu_node structure's | ||
265 | ->qsmask field is printed, which will normally be zero. | ||
258 | 266 | ||
259 | If the relevant grace-period kthread has been unable to run prior to | 267 | If the relevant grace-period kthread has been unable to run prior to |
260 | the stall warning, the following additional line is printed: | 268 | the stall warning, as was the case in the "All QSes seen" line above, |
269 | the following additional line is printed: | ||
261 | 270 | ||
262 | rcu_preempt kthread starved for 2023 jiffies! | 271 | kthread starved for 23807 jiffies! g7073 c7072 f0x0 RCU_GP_WAIT_FQS(3) ->state=0x1 |
263 | 272 | ||
264 | Starving the grace-period kthreads of CPU time can of course result in | 273 | Starving the grace-period kthreads of CPU time can of course result |
265 | RCU CPU stall warnings even when all CPUs and tasks have passed through | 274 | in RCU CPU stall warnings even when all CPUs and tasks have passed |
266 | the required quiescent states. | 275 | through the required quiescent states. The "g" and "c" numbers flag the |
276 | number of the last grace period started and completed, respectively, | ||
277 | the "f" precedes the ->gp_flags command to the grace-period kthread, | ||
278 | the "RCU_GP_WAIT_FQS" indicates that the kthread is waiting for a short | ||
279 | timeout, and the "state" precedes value of the task_struct ->state field. | ||
267 | 280 | ||
268 | 281 | ||
269 | Multiple Warnings From One Stall | 282 | Multiple Warnings From One Stall |
@@ -280,13 +293,28 @@ Stall Warnings for Expedited Grace Periods | |||
280 | If an expedited grace period detects a stall, it will place a message | 293 | If an expedited grace period detects a stall, it will place a message |
281 | like the following in dmesg: | 294 | like the following in dmesg: |
282 | 295 | ||
283 | INFO: rcu_sched detected expedited stalls on CPUs: { 1 2 6 } 26009 jiffies s: 1043 | 296 | INFO: rcu_sched detected expedited stalls on CPUs/tasks: { 7-... } 21119 jiffies s: 73 root: 0x2/. |
284 | 297 | ||
285 | This indicates that CPUs 1, 2, and 6 have failed to respond to a | 298 | This indicates that CPU 7 has failed to respond to a reschedule IPI. |
286 | reschedule IPI, that the expedited grace period has been going on for | 299 | The three periods (".") following the CPU number indicate that the CPU |
287 | 26,009 jiffies, and that the expedited grace-period sequence counter is | 300 | is online (otherwise the first period would instead have been "O"), |
288 | 1043. The fact that this last value is odd indicates that an expedited | 301 | that the CPU was online at the beginning of the expedited grace period |
289 | grace period is in flight. | 302 | (otherwise the second period would have instead been "o"), and that |
303 | the CPU has been online at least once since boot (otherwise, the third | ||
304 | period would instead have been "N"). The number before the "jiffies" | ||
305 | indicates that the expedited grace period has been going on for 21,119 | ||
306 | jiffies. The number following the "s:" indicates that the expedited | ||
307 | grace-period sequence counter is 73. The fact that this last value is | ||
308 | odd indicates that an expedited grace period is in flight. The number | ||
309 | following "root:" is a bitmask that indicates which children of the root | ||
310 | rcu_node structure correspond to CPUs and/or tasks that are blocking the | ||
311 | current expedited grace period. If the tree had more than one level, | ||
312 | additional hex numbers would be printed for the states of the other | ||
313 | rcu_node structures in the tree. | ||
314 | |||
315 | As with normal grace periods, PREEMPT_RCU builds can be stalled by | ||
316 | tasks as well as by CPUs, and that the tasks will be indicated by PID, | ||
317 | for example, "P3421". | ||
290 | 318 | ||
291 | It is entirely possible to see stall warnings from normal and from | 319 | It is entirely possible to see stall warnings from normal and from |
292 | expedited grace periods at about the same time from the same run. | 320 | expedited grace periods at about the same time during the same run. |