Linux 7.4 Workqueue Changes Bring A "10 To 100 Times Faster" Optimization
Linux 7.4 introduces a workqueue optimization that delivers 10 to 100 times faster performance, particularly benefiting large server systems with high core counts.
The optimization changes how workqueue flushing operates by only visiting queues used since the last flush, rather than checking one queue per possible CPU. This approach yields dramatic performance improvements, especially on large systems with many cores.
Performance Gains
On a 192-CPU 2-node machine, flushing an idle per-cpu workqueue increases from 40k to 4.2M operations per second, while an idle unbound one improves from 450k to 4.3M. For multi-threaded scenarios, performance also sees substantial boosts.
Yao Kai reported the XFS CIL workqueue, flushed on every log force, spending up to 64us per flush in the walk on a 128-CPU machine.
Background
Linux workqueues are used for deferring work asynchronously within the kernel. The optimization stems from a September report from Huawei engineer Yao Kai regarding overhead issues with unbounded workqueues.
This improvement represents one of the most significant changes in the workqueue pull request merged for Linux 7.4, offering substantial benefits for enterprise server environments where XFS file systems are commonly deployed.