Merge tag 'wq-for-6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq

Pull workqueue updates from Tejun Heo:

 - Rework the rescuer to process work items one-by-one instead of
   slurping all pending work items in a single pass.

   As there is only one rescuer per workqueue, a single long-blocking
   work item could cause high latency for all tasks queued behind it,
   even after memory pressure is relieved and regular kworkers become
   available to service them.

 - Add CONFIG_BOOTPARAM_WQ_STALL_PANIC build-time option and
   workqueue.panic_on_stall_time parameter for time-based stall panic,
   giving systems more control over workqueue stall handling.

 - Replace BUG_ON() with panic() in the stall panic path for clearer
   intent and more informative output.

* tag 'wq-for-6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
  workqueue: replace BUG_ON with panic in panic_on_wq_watchdog
  workqueue: add time-based panic for stalls
  workqueue: add CONFIG_BOOTPARAM_WQ_STALL_PANIC option
  workqueue: Process extra works in rescuer on memory pressure
  workqueue: Process rescuer work items one-by-one using a cursor
  workqueue: Make send_mayday() take a PWQ argument directly
This commit is contained in:
Linus Torvalds
2026-02-11 13:13:32 -08:00
3 changed files with 149 additions and 36 deletions

View File

@@ -1322,6 +1322,29 @@ config WQ_WATCHDOG
state. This can be configured through kernel parameter
"workqueue.watchdog_thresh" and its sysfs counterpart.
config BOOTPARAM_WQ_STALL_PANIC
int "Panic on Nth workqueue stall"
default 0
range 0 100
depends on WQ_WATCHDOG
help
Set the number of workqueue stalls to trigger a kernel panic.
A workqueue stall occurs when a worker pool doesn't make forward
progress on a pending work item for over 30 seconds (configurable
using the workqueue.watchdog_thresh parameter).
If n = 0, the kernel will not panic on stall. If n > 0, the kernel
will panic after n stall warnings.
The panic can be used in combination with panic_timeout,
to cause the system to reboot automatically after a
stall has been detected. This feature is useful for
high-availability systems that have uptime guarantees and
where a stall must be resolved ASAP.
This setting can be overridden at runtime via the
workqueue.panic_on_stall kernel parameter.
config WQ_CPU_INTENSIVE_REPORT
bool "Report per-cpu work items which hog CPU for too long"
depends on DEBUG_KERNEL