Commit c7f27a8
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: 82607ad ("workqueue: implement lockup detector")
Cc: [email protected] # v4.5+
Assisted-by: claude-code:claude-opus-4-6
Signed-off-by: Song Liu <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>1 parent 98c790b commit c7f27a8
1 file changed
Lines changed: 21 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7699 | 7699 | | |
7700 | 7700 | | |
7701 | 7701 | | |
7702 | | - | |
| 7702 | + | |
| 7703 | + | |
| 7704 | + | |
| 7705 | + | |
| 7706 | + | |
| 7707 | + | |
| 7708 | + | |
| 7709 | + | |
| 7710 | + | |
| 7711 | + | |
| 7712 | + | |
7703 | 7713 | | |
| 7714 | + | |
| 7715 | + | |
| 7716 | + | |
| 7717 | + | |
| 7718 | + | |
| 7719 | + | |
| 7720 | + | |
| 7721 | + | |
| 7722 | + | |
| 7723 | + | |
7704 | 7724 | | |
7705 | 7725 | | |
7706 | 7726 | | |
| |||
7712 | 7732 | | |
7713 | 7733 | | |
7714 | 7734 | | |
7715 | | - | |
7716 | | - | |
7717 | 7735 | | |
7718 | 7736 | | |
7719 | 7737 | | |
| |||
0 commit comments