Commit e8e14ac
workqueue: Show in-flight work item duration in stall diagnostics
When diagnosing workqueue stalls, knowing how long each in-flight work
item has been executing is valuable. Add a current_start timestamp
(jiffies) to struct worker, set it when a work item begins execution in
process_one_work(), and print the elapsed wall-clock time in show_pwq().
Unlike current_at (which tracks CPU runtime and resets on wakeup for
CPU-intensive detection), current_start is never reset because the
diagnostic cares about total wall-clock time including sleeps.
Before: in-flight: 165:stall_work_fn [wq_stall]
After: in-flight: 165:stall_work_fn [wq_stall] for 100s
Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Tejun Heo <tj@kernel.org>1 parent 6037160 commit e8e14ac
2 files changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3204 | 3204 | | |
3205 | 3205 | | |
3206 | 3206 | | |
| 3207 | + | |
3207 | 3208 | | |
3208 | 3209 | | |
3209 | 3210 | | |
| |||
6359 | 6360 | | |
6360 | 6361 | | |
6361 | 6362 | | |
| 6363 | + | |
| 6364 | + | |
6362 | 6365 | | |
6363 | 6366 | | |
6364 | 6367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
0 commit comments