mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [syzbot] [ext4?] BUG: workqueue lockup in update_super_work
@ 2026-11-24 11:36 syzbot
  2026-11-25  0:53 ` Hillf Danton
  2026-11-26 10:25 ` [PATCH] workqueue: Avoid noise generated by real-time tasks Edward Adam Davis
  0 siblings, 2 replies; 7+ messages in thread
From: syzbot @ 2026-11-24 11:36 UTC (permalink / raw)
  To: adilger.kernel, jack, libaokun, linux-ext4, linux-kernel,
	ojaswin, ritesh.list, syzkaller-bugs, tytso, yi.zhang

Hello,

syzbot found the following issue on:

HEAD commit:    a041bdbe1f3a arm64: Drop stdint.h type overrides from asm/..
git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=1410c1d9580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=4e8e6c1701ad8af2
dashboard link: https://syzkaller.appspot.com/bug?extid=97fde463a8ffb9e839d2
compiler:       Debian clang version 22.1.8 (1~deb13u4), Debian LLD 22.1.8
userspace arch: arm64
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=17576985580000

AI-generated root cause summary:
The workqueue watchdog detected a 35-second lockup on CPU 0's per-CPU worker
pool (`pool 2`), where all four busy workers (`update_super_work`,
`smc_ib_port_event_work`, `srcu_invoke_callbacks`, and `wg_packet_tx_worker`)
are in `TASK_RUNNING` (`state:R`) and switched out at `__switch_to`, unable to
be scheduled onto CPU 0 while CPU 1 (`pool 6`) continues running normally.
Because `srcu_invoke_callbacks` and `smc_ib_port_event_work` (which blocked on
`rtnl_lock`) cannot resume on CPU 0, the stall cascades to
`fsnotify_mark_destroy_workfn` (`synchronize_srcu`), `cfg80211_wiphy_work`,
`reg_todo`, and `batadv_tt_purge`. The exact code currently monopolizing CPU 0
cannot be conclusively determined from this report because
`show_cpu_pool_busy_workers()` checks `task_is_running()` rather than whether a
worker is actively executing on the CPU, and therefore skipped
`trigger_single_cpu_backtrace(0)`.

full analysis:  https://syzkaller.appspot.com/x/ai_root_cause?x=97fde463a8ffb9e839d2

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+97fde463a8ffb9e839d2@syzkaller.appspotmail.com

BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 5s!
Showing busy workqueues and worker pools:
workqueue events: flags=0x100
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=6 refcnt=8
    in-flight: 4867:update_super_work for 6s
    pending: refresh_vm_stats BAR(5070), vmstat_shepherd, 2*nsim_dev_hwstats_traffic_work, free_obj_work
  pwq 6: cpus=1 node=0 flags=0x0 nice=0 active=1 refcnt=2
    in-flight: 24:request_firmware_work_func for 42s
workqueue mm_percpu_wq: flags=0x108
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: vmstat_update
workqueue kblockd: flags=0x118
  pwq 3: cpus=0 node=0 flags=0x0 nice=-20 active=2 refcnt=3
    pending: 2*blk_mq_timeout_work
pool 2: cpus=0 node=0 flags=0x0 nice=0 hung=5s workers=5 idle: 1171 10 1104 9
pool 6: cpus=1 node=0 flags=0x0 nice=0 hung=0s workers=6 idle: 26 4849 876 4848 4769
Showing backtraces of busy workers in stalled worker pools:
pool 2:
task:kworker/0:4     state:R  running task     stack:0     pid:4867  tgid:4867  ppid:2      task_flags:0x4208060 flags:0x00000010
Workqueue: events update_super_work
Call trace:
 __switch_to+0x2b4/0x6e4 arch/arm64/kernel/process.c:792 (T)
 context_switch kernel/sched/core.c:5583 [inline]
 __schedule+0x1368/0x2b50 kernel/sched/core.c:7382
 __schedule_loop kernel/sched/core.c:7459 [inline]
 schedule+0x13c/0x20c kernel/sched/core.c:7474
 io_schedule+0x1c/0xe0 kernel/sched/core.c:8146
 bit_wait_io+0x1c/0xe8 kernel/sched/wait_bit.c:258
 __wait_on_bit+0xb8/0x178 kernel/sched/wait_bit.c:52
 out_of_line_wait_on_bit+0x130/0x184 kernel/sched/wait_bit.c:67
 wait_on_bit_io include/linux/wait_bit.h:106 [inline]
 __wait_on_buffer+0x6c/0x7c fs/buffer.c:118
 wait_on_buffer include/linux/buffer_head.h:476 [inline]
 ext4_commit_super+0x2b4/0x458 fs/ext4/super.c:6417
 update_super_work+0x2dc/0x384 fs/ext4/super.c:817
 process_one_work kernel/workqueue.c:3495 [inline]
 process_scheduled_works+0x91c/0x1250 kernel/workqueue.c:3578
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3659
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:854
BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 8s!
BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=-20 stuck for 3s!
Showing busy workqueues and worker pools:
workqueue events: flags=0x100
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=7 refcnt=9
    in-flight: 4867:update_super_work for 9s
    pending: refresh_vm_stats BAR(5070), vmstat_shepherd, 2*nsim_dev_hwstats_traffic_work, free_obj_work, psi_avgs_work
  pwq 6: cpus=1 node=0 flags=0x0 nice=0 active=1 refcnt=2
    in-flight: 24:request_firmware_work_func for 45s
workqueue events_dfl_long: flags=0x2
  pwq 8: cpus=0-1 flags=0x4 nice=0 active=1 refcnt=2
    pending: defense_work_handler
workqueue mm_percpu_wq: flags=0x108
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: vmstat_update
workqueue kblockd: flags=0x118
  pwq 3: cpus=0 node=0 flags=0x0 nice=-20 active=2 refcnt=3
    pending: 2*blk_mq_timeout_work
pool 2: cpus=0 node=0 flags=0x0 nice=0 hung=8s workers=5 idle: 1171 10 1104 9
pool 6: cpus=1 node=0 flags=0x0 nice=0 hung=0s workers=6 idle: 4849 26 876 4848 4769
Showing backtraces of busy workers in stalled worker pools:
pool 2:
task:kworker/0:4     state:R  running task     stack:0     pid:4867  tgid:4867  ppid:2      task_flags:0x4208060 flags:0x00000010
Workqueue: events update_super_work
Call trace:
 __switch_to+0x2b4/0x6e4 arch/arm64/kernel/process.c:792 (T)
 context_switch kernel/sched/core.c:5583 [inline]
 __schedule+0x1368/0x2b50 kernel/sched/core.c:7382
 __schedule_loop kernel/sched/core.c:7459 [inline]
 schedule+0x13c/0x20c kernel/sched/core.c:7474
 io_schedule+0x1c/0xe0 kernel/sched/core.c:8146
 bit_wait_io+0x1c/0xe8 kernel/sched/wait_bit.c:258
 __wait_on_bit+0xb8/0x178 kernel/sched/wait_bit.c:52
 out_of_line_wait_on_bit+0x130/0x184 kernel/sched/wait_bit.c:67
 wait_on_bit_io include/linux/wait_bit.h:106 [inline]
 __wait_on_buffer+0x6c/0x7c fs/buffer.c:118
 wait_on_buffer include/linux/buffer_head.h:476 [inline]
 ext4_commit_super+0x2b4/0x458 fs/ext4/super.c:6417
 update_super_work+0x2dc/0x384 fs/ext4/super.c:817
 process_one_work kernel/workqueue.c:3495 [inline]
 process_scheduled_works+0x91c/0x1250 kernel/workqueue.c:3578
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3659
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:854
pool 3: no worker in running state, cpu=0 is busy (nr_workers=2 nr_idle=2)
The pool might have trouble waking an idle worker.
Backtrace of last woken worker:
task:kworker/0:1H    state:R  running task     stack:0     pid:4368  tgid:4368  ppid:2      task_flags:0x4208060 flags:0x00000010
Workqueue:  0x0 (kblockd)
Call trace:
 __switch_to+0x2b4/0x6e4 arch/arm64/kernel/process.c:792 (T)
 context_switch kernel/sched/core.c:5583 [inline]
 __schedule+0x1368/0x2b50 kernel/sched/core.c:7382
 __schedule_loop kernel/sched/core.c:7459 [inline]
 schedule+0x13c/0x20c kernel/sched/core.c:7474
 worker_thread+0x924/0xbd0 kernel/workqueue.c:3674
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:854
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 5064 Comm: syz-executor298 Not tainted syzkaller #0 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
pstate: 00001000 (nzcv daif -PAN -UAO -TCO -DIT +SSBS BTYPE=--)
pc : 0000ffff92d12354
lr : 0000ffff92c64e84
sp : 0000ffffd134ccf0
x29: 0000ffffd134ccf0 x28: 0000ffff92cb3000 x27: 0000ffff92cb3000
x26: 0000ffff92cb3000 x25: 0000ffff92cb3000 x24: 0000000000000004
x23: 0000ffffd134cdd0 x22: 0000000000000001 x21: 0000ffff92d00000
x20: 0000ffffd134ce90 x19: 0000ffff92d01000 x18: 0000000001503538
x17: 0000000ca3baf921 x16: 0000000000000017 x15: 0000000000800000
x14: 0000000ca3c7df44 x13: 0000000000002490 x12: 000000007fffffff
x11: 0000000000000001 x10: 0000000000000001 x9 : 0000ffff92d0e010
x8 : 0000ffff92d0e000 x7 : 0000000000000000 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000002490 x3 : 0012c684c0000000
x2 : 0000ffff92d12310 x1 : 0000ffffd134ce90 x0 : 0000000000000001
BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 11s!
BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=-20 stuck for 6s!
Showing busy workqueues and worker pools:
workqueue events: flags=0x100
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=7 refcnt=9
    in-flight: 4867:update_super_work for 12s
    pending: refresh_vm_stats BAR(5070), vmstat_shepherd, 2*nsim_dev_hwstats_traffic_work, free_obj_work, psi_avgs_work
  pwq 6: cpus=1 node=0 flags=0x0 nice=0 active=1 refcnt=2
    in-flight: 24:request_firmware_work_func for 48s
workqueue events_unbound: flags=0x2
  pwq 8: cpus=0-1 flags=0x4 nice=0 active=3 refcnt=4
    pending: nsim_dev_trap_report_work, toggle_allocation_gate, nsim_dev_trap_report_work
workqueue mm_percpu_wq: flags=0x108
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: vmstat_update
workqueue kblockd: flags=0x118
  pwq 3: cpus=0 node=0 flags=0x0 nice=-20 active=2 refcnt=3
    pending: 2*blk_mq_timeout_work
pool 2: cpus=0 node=0 flags=0x0 nice=0 hung=11s workers=5 idle: 1171 10 1104 9
pool 6: cpus=1 node=0 flags=0x0 nice=0 hung=0s workers=6 idle: 4849 26 876 4848 4769
Showing backtraces of busy workers in stalled worker pools:
pool 2:
task:kworker/0:4     state:R  running task     stack:0     pid:4867  tgid:4867  ppid:2      task_flags:0x4208060 flags:0x00000010
Workqueue: events update_super_work
Call trace:
 __switch_to+0x2b4/0x6e4 arch/arm64/kernel/process.c:792 (T)
 context_switch kernel/sched/core.c:5583 [inline]
 __schedule+0x1368/0x2b50 kernel/sched/core.c:7382
 __schedule_loop kernel/sched/core.c:7459 [inline]
 schedule+0x13c/0x20c kernel/sched/core.c:7474
 io_schedule+0x1c/0xe0 kernel/sched/core.c:8146
 bit_wait_io+0x1c/0xe8 kernel/sched/wait_bit.c:258
 __wait_on_bit+0xb8/0x178 kernel/sched/wait_bit.c:52
 out_of_line_wait_on_bit+0x130/0x184 kernel/sched/wait_bit.c:67
 wait_on_bit_io include/linux/wait_bit.h:106 [inline]
 __wait_on_buffer+0x6c/0x7c fs/buffer.c:118
 wait_on_buffer include/linux/buffer_head.h:476 [inline]
 ext4_commit_super+0x2b4/0x458 fs/ext4/super.c:6417
 update_super_work+0x2dc/0x384 fs/ext4/super.c:817
 process_one_work kernel/workqueue.c:3495 [inline]
 process_scheduled_works+0x91c/0x1250 kernel/workqueue.c:3578
 worker_thread+0x798/0xbd0 kernel/workqueue.c:3659
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:854
pool 3: no worker in running state, cpu=0 is busy (nr_workers=2 nr_idle=2)
The pool might have trouble waking an idle worker.
Backtrace of last woken worker:
task:kworker/0:1H    state:R  running task     stack:0     pid:4368  tgid:4368  ppid:2      task_flags:0x4208060 flags:0x00000010
Workqueue:  0x0 (kblockd)
Call trace:
 __switch_to+0x2b4/0x6e4 arch/arm64/kernel/process.c:792 (T)
 context_switch kernel/sched/core.c:5583 [inline]
 __schedule+0x1368/0x2b50 kernel/sched/core.c:7382
 __schedule_loop kernel/sched/core.c:7459 [inline]
 schedule+0x13c/0x20c kernel/sched/core.c:7474
 worker_thread+0x924/0xbd0 kernel/workqueue.c:3674
 kthread+0x304/0x3d4 kernel/kthread.c:436
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:854
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 5064 Comm: syz-executor298 Not tainted syzkaller #0 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
pstate: 00001000 (nzcv daif -PAN -UAO -TCO -DIT +SSBS BTYPE=--)
pc : 0000ffff92d12364
lr : 0000ffff92c64e84
sp : 0000ffffd134ccf0
x29: 0000ffffd134ccf0 x28: 0000ffff92cb3000 x27: 0000ffff92cb3000
x26: 0000ffff92cb3000 x25: 0000ffff92cb3000 x24: 0000000000000004
x23: 0000ffffd134cdd0 x22: 0000000000000001 x21: 0000ffff92d00000
x20: 0000ffffd134ce90 x19: 0000ffff92d01000 x18: 0000000001503538
x17: 0000000d5ab774a1 x16: 0000000000000017 x15: 0000000000800000
x14: 0000000d5ac496d8 x13: 00000000000026f6 x12: 000000007fffffff
x11: 0000000000000001 x10: 0000ffffd134ccf0 x9 : 0000ffff92d0e010
x8 : 0000ffff92d0e000 x7 : 0000000000000000 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 00000000000026f6 x3 : 0014dc9380000000
x2 : 0000ffff92d12310 x1 : 0000ffffd134ce90 x0 : 0000000000000001


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [syzbot] [ext4?] BUG: workqueue lockup in update_super_work
  2026-11-24 11:36 [syzbot] [ext4?] BUG: workqueue lockup in update_super_work syzbot
@ 2026-11-25  0:53 ` Hillf Danton
  2026-11-26 10:25 ` [PATCH] workqueue: Avoid noise generated by real-time tasks Edward Adam Davis
  1 sibling, 0 replies; 7+ messages in thread
From: Hillf Danton @ 2026-11-25  0:53 UTC (permalink / raw)
  To: syzbot; +Cc: jack, linux-kernel, Tejun Heo, syzkaller-bugs

> Date: Tue, 24 Nov 2026 03:36:26 -0800
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    a041bdbe1f3a arm64: Drop stdint.h type overrides from asm/..
> git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
> console output: https://syzkaller.appspot.com/x/log.txt?x=1410c1d9580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=4e8e6c1701ad8af2
> dashboard link: https://syzkaller.appspot.com/bug?extid=97fde463a8ffb9e839d2
> compiler:       Debian clang version 22.1.8 (1~deb13u4), Debian LLD 22.1.8
> userspace arch: arm64
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=17576985580000
> 
> AI-generated root cause summary:
> The workqueue watchdog detected a 35-second lockup on CPU 0's per-CPU worker
> pool (`pool 2`), where all four busy workers (`update_super_work`,
> `smc_ib_port_event_work`, `srcu_invoke_callbacks`, and `wg_packet_tx_worker`)
> are in `TASK_RUNNING` (`state:R`) and switched out at `__switch_to`, unable to
> be scheduled onto CPU 0 while CPU 1 (`pool 6`) continues running normally.
> Because `srcu_invoke_callbacks` and `smc_ib_port_event_work` (which blocked on
> `rtnl_lock`) cannot resume on CPU 0, the stall cascades to
> `fsnotify_mark_destroy_workfn` (`synchronize_srcu`), `cfg80211_wiphy_work`,
> `reg_todo`, and `batadv_tt_purge`. The exact code currently monopolizing CPU 0
> cannot be conclusively determined from this report because
> `show_cpu_pool_busy_workers()` checks `task_is_running()` rather than whether a
> worker is actively executing on the CPU, and therefore skipped
> `trigger_single_cpu_backtrace(0)`.
> 
Incorrect, given the print -- The pool might have trouble waking an idle worker.


> full analysis:  https://syzkaller.appspot.com/x/ai_root_cause?x=97fde463a8ffb9e839d2
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+97fde463a8ffb9e839d2@syzkaller.appspotmail.com
> 
> BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 5s!
> Showing busy workqueues and worker pools:
> workqueue events: flags=0x100
>   pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=6 refcnt=8
>     in-flight: 4867:update_super_work for 6s
>     pending: refresh_vm_stats BAR(5070), vmstat_shepherd, 2*nsim_dev_hwstats_traffic_work, free_obj_work
>   pwq 6: cpus=1 node=0 flags=0x0 nice=0 active=1 refcnt=2
>     in-flight: 24:request_firmware_work_func for 42s
> workqueue mm_percpu_wq: flags=0x108
>   pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
>     pending: vmstat_update
> workqueue kblockd: flags=0x118
>   pwq 3: cpus=0 node=0 flags=0x0 nice=-20 active=2 refcnt=3
>     pending: 2*blk_mq_timeout_work
> pool 2: cpus=0 node=0 flags=0x0 nice=0 hung=5s workers=5 idle: 1171 10 1104 9
> pool 6: cpus=1 node=0 flags=0x0 nice=0 hung=0s workers=6 idle: 26 4849 876 4848 4769
> Showing backtraces of busy workers in stalled worker pools:
> pool 2:
> task:kworker/0:4     state:R  running task     stack:0     pid:4867  tgid:4867  ppid:2      task_flags:0x4208060 flags:0x00000010
> Workqueue: events update_super_work
> Call trace:
>  __switch_to+0x2b4/0x6e4 arch/arm64/kernel/process.c:792 (T)
>  context_switch kernel/sched/core.c:5583 [inline]
>  __schedule+0x1368/0x2b50 kernel/sched/core.c:7382
>  __schedule_loop kernel/sched/core.c:7459 [inline]
>  schedule+0x13c/0x20c kernel/sched/core.c:7474
>  io_schedule+0x1c/0xe0 kernel/sched/core.c:8146
>  bit_wait_io+0x1c/0xe8 kernel/sched/wait_bit.c:258
>  __wait_on_bit+0xb8/0x178 kernel/sched/wait_bit.c:52
>  out_of_line_wait_on_bit+0x130/0x184 kernel/sched/wait_bit.c:67
>  wait_on_bit_io include/linux/wait_bit.h:106 [inline]
>  __wait_on_buffer+0x6c/0x7c fs/buffer.c:118
>  wait_on_buffer include/linux/buffer_head.h:476 [inline]
>  ext4_commit_super+0x2b4/0x458 fs/ext4/super.c:6417
>  update_super_work+0x2dc/0x384 fs/ext4/super.c:817
>  process_one_work kernel/workqueue.c:3495 [inline]
>  process_scheduled_works+0x91c/0x1250 kernel/workqueue.c:3578
>  worker_thread+0x798/0xbd0 kernel/workqueue.c:3659
>  kthread+0x304/0x3d4 kernel/kthread.c:436
>  ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:854
> BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 8s!
> BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=-20 stuck for 3s!
> Showing busy workqueues and worker pools:
> workqueue events: flags=0x100
>   pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=7 refcnt=9
>     in-flight: 4867:update_super_work for 9s
>     pending: refresh_vm_stats BAR(5070), vmstat_shepherd, 2*nsim_dev_hwstats_traffic_work, free_obj_work, psi_avgs_work
>   pwq 6: cpus=1 node=0 flags=0x0 nice=0 active=1 refcnt=2
>     in-flight: 24:request_firmware_work_func for 45s
> workqueue events_dfl_long: flags=0x2
>   pwq 8: cpus=0-1 flags=0x4 nice=0 active=1 refcnt=2
>     pending: defense_work_handler
> workqueue mm_percpu_wq: flags=0x108
>   pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
>     pending: vmstat_update
> workqueue kblockd: flags=0x118
>   pwq 3: cpus=0 node=0 flags=0x0 nice=-20 active=2 refcnt=3
>     pending: 2*blk_mq_timeout_work
> pool 2: cpus=0 node=0 flags=0x0 nice=0 hung=8s workers=5 idle: 1171 10 1104 9
> pool 6: cpus=1 node=0 flags=0x0 nice=0 hung=0s workers=6 idle: 4849 26 876 4848 4769
> Showing backtraces of busy workers in stalled worker pools:
> pool 2:
> task:kworker/0:4     state:R  running task     stack:0     pid:4867  tgid:4867  ppid:2      task_flags:0x4208060 flags:0x00000010
> Workqueue: events update_super_work
> Call trace:
>  __switch_to+0x2b4/0x6e4 arch/arm64/kernel/process.c:792 (T)
>  context_switch kernel/sched/core.c:5583 [inline]
>  __schedule+0x1368/0x2b50 kernel/sched/core.c:7382
>  __schedule_loop kernel/sched/core.c:7459 [inline]
>  schedule+0x13c/0x20c kernel/sched/core.c:7474
>  io_schedule+0x1c/0xe0 kernel/sched/core.c:8146
>  bit_wait_io+0x1c/0xe8 kernel/sched/wait_bit.c:258
>  __wait_on_bit+0xb8/0x178 kernel/sched/wait_bit.c:52
>  out_of_line_wait_on_bit+0x130/0x184 kernel/sched/wait_bit.c:67
>  wait_on_bit_io include/linux/wait_bit.h:106 [inline]
>  __wait_on_buffer+0x6c/0x7c fs/buffer.c:118
>  wait_on_buffer include/linux/buffer_head.h:476 [inline]
>  ext4_commit_super+0x2b4/0x458 fs/ext4/super.c:6417
>  update_super_work+0x2dc/0x384 fs/ext4/super.c:817
>  process_one_work kernel/workqueue.c:3495 [inline]
>  process_scheduled_works+0x91c/0x1250 kernel/workqueue.c:3578
>  worker_thread+0x798/0xbd0 kernel/workqueue.c:3659
>  kthread+0x304/0x3d4 kernel/kthread.c:436
>  ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:854
> pool 3: no worker in running state, cpu=0 is busy (nr_workers=2 nr_idle=2)
> The pool might have trouble waking an idle worker.
> Backtrace of last woken worker:
> task:kworker/0:1H    state:R  running task     stack:0     pid:4368  tgid:4368  ppid:2      task_flags:0x4208060 flags:0x00000010
> Workqueue:  0x0 (kblockd)
> Call trace:
>  __switch_to+0x2b4/0x6e4 arch/arm64/kernel/process.c:792 (T)
>  context_switch kernel/sched/core.c:5583 [inline]
>  __schedule+0x1368/0x2b50 kernel/sched/core.c:7382
>  __schedule_loop kernel/sched/core.c:7459 [inline]
>  schedule+0x13c/0x20c kernel/sched/core.c:7474
>  worker_thread+0x924/0xbd0 kernel/workqueue.c:3674
>  kthread+0x304/0x3d4 kernel/kthread.c:436
>  ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:854
> Sending NMI from CPU 1 to CPUs 0:
> NMI backtrace for cpu 0
> CPU: 0 UID: 0 PID: 5064 Comm: syz-executor298 Not tainted syzkaller #0 PREEMPT 
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
> pstate: 00001000 (nzcv daif -PAN -UAO -TCO -DIT +SSBS BTYPE=--)
> pc : 0000ffff92d12354
> lr : 0000ffff92c64e84
> sp : 0000ffffd134ccf0
> x29: 0000ffffd134ccf0 x28: 0000ffff92cb3000 x27: 0000ffff92cb3000
> x26: 0000ffff92cb3000 x25: 0000ffff92cb3000 x24: 0000000000000004
> x23: 0000ffffd134cdd0 x22: 0000000000000001 x21: 0000ffff92d00000
> x20: 0000ffffd134ce90 x19: 0000ffff92d01000 x18: 0000000001503538
> x17: 0000000ca3baf921 x16: 0000000000000017 x15: 0000000000800000
> x14: 0000000ca3c7df44 x13: 0000000000002490 x12: 000000007fffffff
> x11: 0000000000000001 x10: 0000000000000001 x9 : 0000ffff92d0e010
> x8 : 0000ffff92d0e000 x7 : 0000000000000000 x6 : 0000000000000000
> x5 : 0000000000000000 x4 : 0000000000002490 x3 : 0012c684c0000000
> x2 : 0000ffff92d12310 x1 : 0000ffffd134ce90 x0 : 0000000000000001
> BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 11s!
> BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=-20 stuck for 6s!
> Showing busy workqueues and worker pools:
> workqueue events: flags=0x100
>   pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=7 refcnt=9
>     in-flight: 4867:update_super_work for 12s
>     pending: refresh_vm_stats BAR(5070), vmstat_shepherd, 2*nsim_dev_hwstats_traffic_work, free_obj_work, psi_avgs_work
>   pwq 6: cpus=1 node=0 flags=0x0 nice=0 active=1 refcnt=2
>     in-flight: 24:request_firmware_work_func for 48s
> workqueue events_unbound: flags=0x2
>   pwq 8: cpus=0-1 flags=0x4 nice=0 active=3 refcnt=4
>     pending: nsim_dev_trap_report_work, toggle_allocation_gate, nsim_dev_trap_report_work
> workqueue mm_percpu_wq: flags=0x108
>   pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
>     pending: vmstat_update
> workqueue kblockd: flags=0x118
>   pwq 3: cpus=0 node=0 flags=0x0 nice=-20 active=2 refcnt=3
>     pending: 2*blk_mq_timeout_work
> pool 2: cpus=0 node=0 flags=0x0 nice=0 hung=11s workers=5 idle: 1171 10 1104 9
> pool 6: cpus=1 node=0 flags=0x0 nice=0 hung=0s workers=6 idle: 4849 26 876 4848 4769
> Showing backtraces of busy workers in stalled worker pools:
> pool 2:
> task:kworker/0:4     state:R  running task     stack:0     pid:4867  tgid:4867  ppid:2      task_flags:0x4208060 flags:0x00000010
> Workqueue: events update_super_work
> Call trace:
>  __switch_to+0x2b4/0x6e4 arch/arm64/kernel/process.c:792 (T)
>  context_switch kernel/sched/core.c:5583 [inline]
>  __schedule+0x1368/0x2b50 kernel/sched/core.c:7382
>  __schedule_loop kernel/sched/core.c:7459 [inline]
>  schedule+0x13c/0x20c kernel/sched/core.c:7474
>  io_schedule+0x1c/0xe0 kernel/sched/core.c:8146
>  bit_wait_io+0x1c/0xe8 kernel/sched/wait_bit.c:258
>  __wait_on_bit+0xb8/0x178 kernel/sched/wait_bit.c:52
>  out_of_line_wait_on_bit+0x130/0x184 kernel/sched/wait_bit.c:67
>  wait_on_bit_io include/linux/wait_bit.h:106 [inline]
>  __wait_on_buffer+0x6c/0x7c fs/buffer.c:118
>  wait_on_buffer include/linux/buffer_head.h:476 [inline]
>  ext4_commit_super+0x2b4/0x458 fs/ext4/super.c:6417
>  update_super_work+0x2dc/0x384 fs/ext4/super.c:817
>  process_one_work kernel/workqueue.c:3495 [inline]
>  process_scheduled_works+0x91c/0x1250 kernel/workqueue.c:3578
>  worker_thread+0x798/0xbd0 kernel/workqueue.c:3659
>  kthread+0x304/0x3d4 kernel/kthread.c:436
>  ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:854
> pool 3: no worker in running state, cpu=0 is busy (nr_workers=2 nr_idle=2)
> The pool might have trouble waking an idle worker.
> Backtrace of last woken worker:
> task:kworker/0:1H    state:R  running task     stack:0     pid:4368  tgid:4368  ppid:2      task_flags:0x4208060 flags:0x00000010
> Workqueue:  0x0 (kblockd)
> Call trace:
>  __switch_to+0x2b4/0x6e4 arch/arm64/kernel/process.c:792 (T)
>  context_switch kernel/sched/core.c:5583 [inline]
>  __schedule+0x1368/0x2b50 kernel/sched/core.c:7382
>  __schedule_loop kernel/sched/core.c:7459 [inline]
>  schedule+0x13c/0x20c kernel/sched/core.c:7474
>  worker_thread+0x924/0xbd0 kernel/workqueue.c:3674
>  kthread+0x304/0x3d4 kernel/kthread.c:436
>  ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:854
> Sending NMI from CPU 1 to CPUs 0:
> NMI backtrace for cpu 0
> CPU: 0 UID: 0 PID: 5064 Comm: syz-executor298 Not tainted syzkaller #0 PREEMPT 
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
> pstate: 00001000 (nzcv daif -PAN -UAO -TCO -DIT +SSBS BTYPE=--)
> pc : 0000ffff92d12364
> lr : 0000ffff92c64e84
> sp : 0000ffffd134ccf0
> x29: 0000ffffd134ccf0 x28: 0000ffff92cb3000 x27: 0000ffff92cb3000
> x26: 0000ffff92cb3000 x25: 0000ffff92cb3000 x24: 0000000000000004
> x23: 0000ffffd134cdd0 x22: 0000000000000001 x21: 0000ffff92d00000
> x20: 0000ffffd134ce90 x19: 0000ffff92d01000 x18: 0000000001503538
> x17: 0000000d5ab774a1 x16: 0000000000000017 x15: 0000000000800000
> x14: 0000000d5ac496d8 x13: 00000000000026f6 x12: 000000007fffffff
> x11: 0000000000000001 x10: 0000ffffd134ccf0 x9 : 0000ffff92d0e010
> x8 : 0000ffff92d0e000 x7 : 0000000000000000 x6 : 0000000000000000
> x5 : 0000000000000000 x4 : 00000000000026f6 x3 : 0014dc9380000000
> x2 : 0000ffff92d12310 x1 : 0000ffffd134ce90 x0 : 0000000000000001

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] workqueue: Avoid noise generated by real-time tasks
  2026-11-24 11:36 [syzbot] [ext4?] BUG: workqueue lockup in update_super_work syzbot
  2026-11-25  0:53 ` Hillf Danton
@ 2026-11-26 10:25 ` Edward Adam Davis
  2026-11-26 10:57   ` Tejun Heo
                     ` (2 more replies)
  1 sibling, 3 replies; 7+ messages in thread
From: Edward Adam Davis @ 2026-11-26 10:25 UTC (permalink / raw)
  To: syzbot+97fde463a8ffb9e839d2
  Cc: tj, jiangshanlai, linux-kernel, syzkaller-bugs

A user creates a SCHED_FIFO real-time thread and pins it to CPU0, and arm
watchdog timer on CPU1 with 3s threshold. The real-time thread runs for an
extended period without voluntarily yielding the CPU, preventing standard
kworker threads on CPU0 from gaining access to the processor.

As a result, certain kernel works cannot be executed in a timely manner,
which may even trigger a watchdog report:

BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 5s!
Showing busy workqueues and worker pools:
workqueue mm_percpu_wq: flags=0x108
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: vmstat_update

To address this, a check for CPU-bound tasks has been added to the work
pool; this helps prevent false-positive reports caused by prolonged CPU
occupancy by real-time tasks.

Fixes: 82607adcf9cd ("workqueue: implement lockup detector")
Reported-by: syzbot+97fde463a8ffb9e839d2@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=97fde463a8ffb9e839d2
Signed-off-by: Edward Adam Davis <eadavis@sina.com>
---
 kernel/workqueue.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index af845214e78b..daf7aad79062 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -52,6 +52,7 @@
 #include <linux/uaccess.h>
 #include <linux/sched/isolation.h>
 #include <linux/sched/debug.h>
+#include <sched/sched.h>
 #include <linux/nmi.h>
 #include <linux/kvm_para.h>
 #include <linux/delay.h>
@@ -8202,6 +8203,8 @@ static void wq_watchdog_timer_fn(struct timer_list *unused)
 		 * is a hotter path.
 		 */
 		if (time_after(now, ts + thresh)) {
+			struct task_struct *p;
+
 			scoped_guard(raw_spinlock_irqsave, &pool->lock) {
 				pool_ts = pool->last_progress_ts;
 				if (time_after(pool_ts, touched))
@@ -8212,6 +8215,11 @@ static void wq_watchdog_timer_fn(struct timer_list *unused)
 			if (!time_after(now, ts + thresh))
 				continue;
 
+			p = pool->cpu >= 0 ? cpu_curr(pool->cpu) : NULL;
+			if (p && (p->policy == SCHED_FIFO ||
+				  p->policy == SCHED_RR))
+				continue;
+
 			lockup_detected = true;
 			stall_time = jiffies_to_msecs(now - pool_ts) / 1000;
 			max_stall_time = max(max_stall_time, stall_time);
-- 
2.43.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] workqueue: Avoid noise generated by real-time tasks
  2026-11-26 10:25 ` [PATCH] workqueue: Avoid noise generated by real-time tasks Edward Adam Davis
@ 2026-11-26 10:57   ` Tejun Heo
  2026-11-27  5:07     ` Edward Adam Davis
  2026-11-27  5:40   ` [PATCH next v2] workqueue: Avoid noise generated by userspace realtime tasks Edward Adam Davis
  2026-11-29 22:46   ` [PATCH] workqueue: Avoid noise generated by real-time tasks kernel test robot
  2 siblings, 1 reply; 7+ messages in thread
From: Tejun Heo @ 2026-11-26 10:57 UTC (permalink / raw)
  To: Edward Adam Davis
  Cc: syzbot+97fde463a8ffb9e839d2, jiangshanlai, linux-kernel, syzkaller-bugs

On Thu, Nov 26, 2026 at 06:25:30PM +0800, Edward Adam Davis wrote:
> A user creates a SCHED_FIFO real-time thread and pins it to CPU0, and arm
> watchdog timer on CPU1 with 3s threshold. The real-time thread runs for an
> extended period without voluntarily yielding the CPU, preventing standard
> kworker threads on CPU0 from gaining access to the processor.
> 
> As a result, certain kernel works cannot be executed in a timely manner,
> which may even trigger a watchdog report:
> 
> BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 5s!
> Showing busy workqueues and worker pools:
> workqueue mm_percpu_wq: flags=0x108
>   pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
>     pending: vmstat_update
> 
> To address this, a check for CPU-bound tasks has been added to the work
> pool; this helps prevent false-positive reports caused by prolonged CPU
> occupancy by real-time tasks.

Workqueue did lock up tho? This is one of the conditions that the mechanism
is intended to warn about.

-- 
tejun

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] workqueue: Avoid noise generated by real-time tasks
  2026-11-26 10:57   ` Tejun Heo
@ 2026-11-27  5:07     ` Edward Adam Davis
  0 siblings, 0 replies; 7+ messages in thread
From: Edward Adam Davis @ 2026-11-27  5:07 UTC (permalink / raw)
  To: tj
  Cc: eadavis, jiangshanlai, linux-kernel, syzbot+97fde463a8ffb9e839d2,
	syzkaller-bugs

From: Edward Aadm Davis <eadavis@sina.com>

On Thu, 26 Nov 2026 00:57:38 -1000, Tejun Heo wrote:
> > A user creates a SCHED_FIFO real-time thread and pins it to CPU0, and arm
> > watchdog timer on CPU1 with 3s threshold. The real-time thread runs for an
> > extended period without voluntarily yielding the CPU, preventing standard
> > kworker threads on CPU0 from gaining access to the processor.
> > 
> > As a result, certain kernel works cannot be executed in a timely manner,
> > which may even trigger a watchdog report:
> > 
> > BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 5s!
> > Showing busy workqueues and worker pools:
> > workqueue mm_percpu_wq: flags=0x108
> >   pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
> >     pending: vmstat_update
> > 
> > To address this, a check for CPU-bound tasks has been added to the work
> > pool; this helps prevent false-positive reports caused by prolonged CPU
> > occupancy by real-time tasks.
> 
> Workqueue did lock up tho? This is one of the conditions that the mechanism
> is intended to warn about.
For userspace realtime tasks, the mechanism same?

BR,
Edward

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH next v2] workqueue: Avoid noise generated by userspace realtime tasks
  2026-11-26 10:25 ` [PATCH] workqueue: Avoid noise generated by real-time tasks Edward Adam Davis
  2026-11-26 10:57   ` Tejun Heo
@ 2026-11-27  5:40   ` Edward Adam Davis
  2026-11-29 22:46   ` [PATCH] workqueue: Avoid noise generated by real-time tasks kernel test robot
  2 siblings, 0 replies; 7+ messages in thread
From: Edward Adam Davis @ 2026-11-27  5:40 UTC (permalink / raw)
  To: eadavis
  Cc: jiangshanlai, linux-kernel, syzbot+97fde463a8ffb9e839d2,
	syzkaller-bugs, tj

A user creates a SCHED_FIFO real-time thread and pins it to CPU0, and arm
watchdog timer on CPU1 with 3s threshold. The real-time thread runs for an
extended period without voluntarily yielding the CPU, preventing standard
kworker threads on CPU0 from gaining access to the processor.

As a result, certain kernel works cannot be executed in a timely manner,
which may even trigger a watchdog report:

BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 5s!
Showing busy workqueues and worker pools:
workqueue mm_percpu_wq: flags=0x108
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=1 refcnt=2
    pending: vmstat_update

To address this, a check for CPU-bound tasks has been added to the work
pool; this helps prevent false-positive reports caused by prolonged CPU
occupancy by real-time tasks.

Fixes: 82607adcf9cd ("workqueue: implement lockup detector")
Reported-by: syzbot+97fde463a8ffb9e839d2@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=97fde463a8ffb9e839d2
Signed-off-by: Edward Adam Davis <eadavis@sina.com>
---
v1 -> v2:
 1. update subject
 2. use cpu_curr_snapshot_rcu() to get stall cpu's current task
 3. Exclude cases where tasks running on a stalled CPU are kernel threads
 4. not for RT kernel

 kernel/workqueue.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index baadc7815585..9bd9cccdf3cf 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -8287,6 +8287,23 @@ static void wq_watchdog_timer_fn(struct timer_list *unused)
 			if (!time_after(now, ts + thresh))
 				continue;
 
+			if (!IS_ENABLED(CONFIG_PREEMPT_RT)) {
+				struct task_struct *p;
+				unsigned int policy;
+				int cpu;
+
+				cpu = pool->cpu;
+				if (cpu >= 0 && !(pool->flags & POOL_DISASSOCIATED)) {
+					guard(rcu)();
+					p = cpu_curr_snapshot_rcu(cpu);
+					if (p && !(p->flags & PF_KTHREAD)) {
+						policy = READ_ONCE(p->policy);
+						if (policy == SCHED_FIFO ||
+						    policy == SCHED_RR)
+							continue;
+					}
+				}
+			}
 			lockup_detected = true;
 			stall_time = jiffies_to_msecs(now - pool_ts) / 1000;
 			max_stall_time = max(max_stall_time, stall_time);
-- 
2.43.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] workqueue: Avoid noise generated by real-time tasks
  2026-11-26 10:25 ` [PATCH] workqueue: Avoid noise generated by real-time tasks Edward Adam Davis
  2026-11-26 10:57   ` Tejun Heo
  2026-11-27  5:40   ` [PATCH next v2] workqueue: Avoid noise generated by userspace realtime tasks Edward Adam Davis
@ 2026-11-29 22:46   ` kernel test robot
  2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2026-11-29 22:46 UTC (permalink / raw)
  To: Edward Adam Davis, syzbot+97fde463a8ffb9e839d2
  Cc: oe-kbuild-all, tj, jiangshanlai, linux-kernel, syzkaller-bugs

Hi Edward,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tj-wq/for-next]
[also build test WARNING on linus/master v7.4-rc4 next-20261127]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Edward-Adam-Davis/workqueue-Avoid-noise-generated-by-real-time-tasks/20261126-182530
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-next
patch link:    https://lore.kernel.org/r/20261126102530.37205-1-eadavis%40sina.com
patch subject: [PATCH] workqueue: Avoid noise generated by real-time tasks
config: powerpc64-randconfig-r2301-20261129 (https://download.01.org/0day-ci/archive/20261129/20261129234130.on7LtRsQ-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 10.5.0
sparse: v0.6.5-rc1-21-g84ec0658
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261129/20261129234130.on7LtRsQ-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261129234130.on7LtRsQ-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> kernel/workqueue.c:8319:27: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct task_struct *p @@     got struct task_struct [noderef] __rcu * @@
   kernel/workqueue.c:8319:27: sparse:     expected struct task_struct *p
   kernel/workqueue.c:8319:27: sparse:     got struct task_struct [noderef] __rcu *

vim +8319 kernel/workqueue.c

  8254	
  8255	static void wq_watchdog_timer_fn(struct timer_list *unused)
  8256	{
  8257		unsigned long thresh = READ_ONCE(wq_watchdog_thresh) * HZ;
  8258		unsigned int max_stall_time = 0;
  8259		bool lockup_detected = false;
  8260		bool cpu_pool_stall = false;
  8261		unsigned long now = jiffies;
  8262		struct worker_pool *pool;
  8263		unsigned int stall_time;
  8264		int pi;
  8265	
  8266		if (!thresh)
  8267			return;
  8268	
  8269		for_each_pool(pool, pi) {
  8270			unsigned long pool_ts, touched, ts;
  8271	
  8272			pool->cpu_stall = false;
  8273			if (list_empty(&pool->worklist))
  8274				continue;
  8275	
  8276			/*
  8277			 * If a virtual machine is stopped by the host it can look to
  8278			 * the watchdog like a stall.
  8279			 */
  8280			kvm_check_and_clear_guest_paused();
  8281	
  8282			/* get the latest of pool and touched timestamps */
  8283			if (pool->cpu >= 0)
  8284				touched = READ_ONCE(per_cpu(wq_watchdog_touched_cpu, pool->cpu));
  8285			else
  8286				touched = READ_ONCE(wq_watchdog_touched);
  8287			pool_ts = READ_ONCE(pool->last_progress_ts);
  8288	
  8289			if (time_after(pool_ts, touched))
  8290				ts = pool_ts;
  8291			else
  8292				ts = touched;
  8293	
  8294			/*
  8295			 * Did we stall?
  8296			 *
  8297			 * Do a lockless check first to do not disturb the system.
  8298			 *
  8299			 * Prevent false positives by double checking the timestamp
  8300			 * under pool->lock. The lock makes sure that the check reads
  8301			 * an updated pool->last_progress_ts when this CPU saw
  8302			 * an already updated pool->worklist above. It seems better
  8303			 * than adding another barrier into __queue_work() which
  8304			 * is a hotter path.
  8305			 */
  8306			if (time_after(now, ts + thresh)) {
  8307				struct task_struct *p;
  8308	
  8309				scoped_guard(raw_spinlock_irqsave, &pool->lock) {
  8310					pool_ts = pool->last_progress_ts;
  8311					if (time_after(pool_ts, touched))
  8312						ts = pool_ts;
  8313					else
  8314						ts = touched;
  8315				}
  8316				if (!time_after(now, ts + thresh))
  8317					continue;
  8318	
> 8319				p = pool->cpu >= 0 ? cpu_curr(pool->cpu) : NULL;
  8320				if (p && (p->policy == SCHED_FIFO ||
  8321					  p->policy == SCHED_RR))
  8322					continue;
  8323	
  8324				lockup_detected = true;
  8325				stall_time = jiffies_to_msecs(now - pool_ts) / 1000;
  8326				max_stall_time = max(max_stall_time, stall_time);
  8327				if (is_percpu_pool(pool) && !(pool->flags & POOL_BH)) {
  8328					pool->cpu_stall = true;
  8329					cpu_pool_stall = true;
  8330				}
  8331				pr_emerg("BUG: workqueue lockup - pool");
  8332				pr_cont_pool_info(pool);
  8333				pr_cont(" stuck for %us!\n", stall_time);
  8334			}
  8335		}
  8336	
  8337		if (lockup_detected)
  8338			show_all_workqueues();
  8339	
  8340		if (cpu_pool_stall)
  8341			show_cpu_pools_busy_workers();
  8342	
  8343		if (lockup_detected)
  8344			panic_on_wq_watchdog(max_stall_time);
  8345	
  8346		wq_watchdog_reset_touched();
  8347		mod_timer(&wq_watchdog_timer, jiffies + thresh);
  8348	}
  8349	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-29 22:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-24 11:36 [syzbot] [ext4?] BUG: workqueue lockup in update_super_work syzbot
2026-11-25  0:53 ` Hillf Danton
2026-11-26 10:25 ` [PATCH] workqueue: Avoid noise generated by real-time tasks Edward Adam Davis
2026-11-26 10:57   ` Tejun Heo
2026-11-27  5:07     ` Edward Adam Davis
2026-11-27  5:40   ` [PATCH next v2] workqueue: Avoid noise generated by userspace realtime tasks Edward Adam Davis
2026-11-29 22:46   ` [PATCH] workqueue: Avoid noise generated by real-time tasks kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®