Linux 6.13 Quadrupling Workqueue Concurrency Limit

Written by Michael Larabel in Linux Kernel on 18 November 2024 at 04:32 PM EST. 1 Comment
LINUX KERNEL
The Linux kernel Workqueue (WQ) is used for handling asynchronous process execution. For the past many years there has been an upper limit on the number of workqueue execution contexts per CPU at 512, but with Linux 6.13 that is being quadrupled to a limit of 2048.

Sent out today was the workqueue pull request for Linux 6.13 and of the two changes this cycle, most notable is increasing the maximum concurrency limit:
"Maximum concurrency limit of 512 which was set a long time ago is too low now. A legitimate use (BPF cgroup release) of system_wq could saturate it under stress test conditions leading to false dependencies and deadlocks. While the offending use was switched to a dedicated workqueue, use the opportunity to bump WQ_MAX_ACTIVE four fold and document that system workqueue shouldn't be saturated. Workqueue should add at least a warning mechanism for cases where system workqueues are saturated."

That 512 limit was set a decade and a half ago. But with the vastly increasing sizes of today's servers, it's time to increase that limit.

Linux WQ 2048 increase


The other workqueue change for Linux 6.13 is also notable in that it's reducing expensive locking around unbound workqueues:
"Recent workqueue updates to support more flexible execution topology made unbound workqueues use per-cpu worker pool frontends which pushed up workqueue flush overhead. As consecutive CPUs are likely to be pointing to the same worker pool, reduce overhead by switching locks only when necessary."

These WQ changes are now pending for the Linux 6.13 merge window.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week