Re: [PATCH 0/4] workqueue: Detect stalled in-flight workers

From: Tejun Heo

Date: Wed Feb 11 2026 - 13:56:22 EST


Hello,

On Wed, Feb 11, 2026 at 04:29:14AM -0800, Breno Leitao wrote:
> The workqueue watchdog detects pools that haven't made forward progress
> by checking whether pending work items on the worklist have been waiting
> too long. However, this approach has a blind spot: if a pool has only
> one work item and that item has already been dequeued and is executing on
> a worker, the worklist is empty and the watchdog skips the pool entirely.
> This means a single hogged worker with no other pending work is invisible
> to the stall detector.
>
> I was able to come up with the following example that shows this blind
> spot:
>
> static void stall_work_fn(struct work_struct *work)
> {
> for (;;) {
> mdelay(1000);
> cond_resched();
> }
> }

Workqueue doesn't require users to limit execution time. As long as there is
enough supply of concurrency to avoid stalling of pending work items, work
items can run as long as they want, including indefinitely. Workqueue stall
is there to indicate that there is insufficient supply of concurrency.

Thanks.

--
tejun