Re: [PATCH v2 3/5] workqueue: Show in-flight work item duration in stall diagnostics
From: Song Liu
Date: Thu Mar 05 2026 - 12:17:35 EST
On Thu, Mar 5, 2026 at 8:16 AM Breno Leitao <leitao@xxxxxxxxxx> wrote:
>
> 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@xxxxxxxxxx>
Acked-by: Song Liu <song@xxxxxxxxxx>
This shows really useful information. Thanks!