Commit 989d478
committed
taskq: deadman: log a message if a taskq has not made progress
It is very difficult to debug situations where all threads on a taskq go
to sleep waiting for some condition that will not be satisfied until
some task queued on that taskq performs some task. Its usually easy to
see that the threads are waiting, but less easy to see that unscheduled
tasks exist.
This adds a simple deadman logging function to each taskq. The first
time a taskq picks up a thread, it arms the timer to expire in
spl_taskq_deadman_timeout seconds (default 20s). If another thread picks
up a new task, the timer is rearmed. When the last active thread
completes its task, the timer is disarmed.
All together, this means the deadman will fire if no new tasks have
started or existing tasks have completed within the configured time. As
long as the taskq is making progress, everything will be silent.
When it fires, it will log a notice to the kernel log:
[ 28.715019] spl: taskq stuck for 20s: z_null_int.0
[1/1 threads active, 35 tasks queued]
If it clears by itself, that is, this was a genuinely long-running
task, a second message will be logged:
[ 38.819171] spl: taskq resumed after s105s: z_null_iss.0
spl_taskq_deadman_timeout=0 will disable the facility entirely.
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Signed-off-by: Rob Norris <[email protected]>1 parent 24aaf3a commit 989d478
File tree
4 files changed
+103
-6
lines changed- config
- include/os/linux/spl/sys
- man/man4
- module/os/linux/spl
4 files changed
+103
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
6 | 17 | | |
7 | 18 | | |
8 | 19 | | |
| |||
12 | 23 | | |
13 | 24 | | |
14 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
15 | 36 | | |
16 | 37 | | |
17 | 38 | | |
| |||
24 | 45 | | |
25 | 46 | | |
26 | 47 | | |
| 48 | + | |
27 | 49 | | |
28 | 50 | | |
29 | 51 | | |
30 | 52 | | |
| 53 | + | |
31 | 54 | | |
32 | 55 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | | - | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
133 | 142 | | |
134 | 143 | | |
135 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
| |||
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
145 | 157 | | |
146 | 158 | | |
147 | 159 | | |
| |||
357 | 369 | | |
358 | 370 | | |
359 | 371 | | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
360 | 400 | | |
361 | 401 | | |
362 | 402 | | |
| |||
1071 | 1111 | | |
1072 | 1112 | | |
1073 | 1113 | | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
1074 | 1119 | | |
1075 | 1120 | | |
1076 | 1121 | | |
| |||
1096 | 1141 | | |
1097 | 1142 | | |
1098 | 1143 | | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
1099 | 1159 | | |
1100 | 1160 | | |
1101 | 1161 | | |
| |||
1375 | 1435 | | |
1376 | 1436 | | |
1377 | 1437 | | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
1378 | 1441 | | |
1379 | 1442 | | |
1380 | 1443 | | |
| |||
0 commit comments