]> git.ipfire.org Git - thirdparty/linux.git/commit
workqueue: Fix false positive stall reports
authorSong Liu <song@kernel.org>
Sun, 22 Mar 2026 03:30:45 +0000 (20:30 -0700)
committerTejun Heo <tj@kernel.org>
Sun, 22 Mar 2026 04:34:59 +0000 (18:34 -1000)
commitc7f27a8ab9f2f43570f0725256597a0d7abe2c5b
tree5541892293a77b8543d0601242fd6e5a209f7ab6
parent98c790b100764102d877e9339471b8c4c9233f2c
workqueue: Fix false positive stall reports

On weakly ordered architectures (e.g., arm64), the lockless check in
wq_watchdog_timer_fn() can observe a reordering between the worklist
insertion and the last_progress_ts update. Specifically, the watchdog
can see a non-empty worklist (from a list_add) while reading a stale
last_progress_ts value, causing a false positive stall report.

This was confirmed by reading pool->last_progress_ts again after holding
pool->lock in wq_watchdog_timer_fn():

  workqueue watchdog: pool 7 false positive detected!
    lockless_ts=4784580465 locked_ts=4785033728
    diff=453263ms worklist_empty=0

To avoid slowing down the hot path (queue_work, etc.), recheck
last_progress_ts with pool->lock held. This will eliminate the false
positive with minimal overhead.

Remove two extra empty lines in wq_watchdog_timer_fn() as we are on it.

Fixes: 82607adcf9cd ("workqueue: implement lockup detector")
Cc: stable@vger.kernel.org # v4.5+
Assisted-by: claude-code:claude-opus-4-6
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c