Re: [QUESTION] workqueue: Reducing flush_workqueue() overhead for unbound workqueues
From: Yao Kai
Date: Sun Sep 06 2026 - 22:21:27 EST
On 9/2/2026 5:11 AM, Tejun Heo wrote:
Hello,
On Tue, Sep 01, 2026 at 04:46:06PM +0800, Yao Kai wrote:
Is there a recommended way to avoid this overhead for such case,
I would appreciate guidance on how this problem should be solved.
Posted a patchset which makes flush_workqueue() visit only the pwqs which
have been active since the last flush:
https://lore.kernel.org/all/20260901210929.3092513-1-tj@xxxxxxxxxx/
Can you please test whether it resolves the fsync latency issue you're
seeing?
Thanks.
--
tejun
Sorry for the late reply. Because my server encountered a hardware failure,
I was unable to test the previous comparison data.
This issue was discovered when running MySQL sysbench on XFS. When we
migrated the kernel from 5.10 to 6.6, we observed a 60% performance drop
in MySQL sysbench. After investigation, we found that the time spent on
`flush_workqueue_prep_pwqs` had increased significantly.
After my colleague applied your new patches, the performance of MySQL
sysbench returned to the level of the 5.10 kernel, so I believe this
can solve the problem.
Thanks,
Yao