Re: [PATCH v2 5/5] workqueue: Add stall detector sample module
From: Song Liu
Date: Thu Mar 05 2026 - 12:27:12 EST
On Thu, Mar 5, 2026 at 8:16 AM Breno Leitao <leitao@xxxxxxxxxx> wrote:
>
> Add a sample module under samples/workqueue/stall_detector/ that
> reproduces a workqueue stall caused by PF_WQ_WORKER misuse. The
> module queues two work items on the same per-CPU pool, then clears
> PF_WQ_WORKER and sleeps in wait_event_idle(), hiding from the
> concurrency manager and stalling the second work item indefinitely.
Clearing PF_WQ_WORKER is an interesting way to trigger the stall.
>
> This is useful for testing the workqueue watchdog stall diagnostics.
>
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
Acked-by: Song Liu <song@xxxxxxxxxx>
> ---
> samples/workqueue/stall_detector/Makefile | 1 +
> samples/workqueue/stall_detector/wq_stall.c | 98 +++++++++++++++++++++++++++++
> 2 files changed, 99 insertions(+)