Bug 20510 - [backport] Reduce expensive locks for unbound workqueue
Summary: [backport] Reduce expensive locks for unbound workqueue
Status: NEW
Alias: None
Product: ANCK 6.6 Dev
Classification: ANCK
Component: generic (show other bugs) generic
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: AubreyLi
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-21 08:39 UTC by AubreyLi
Modified: 2025-04-21 08:52 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description AubreyLi intel_group 2025-04-21 08:39:10 UTC
For unbound workqueue, pwqs usually map to just a few pools. Most of
the time, pwqs will be linked sequentially to wq->pwqs list by cpu 
index.  Usually, consecutive CPUs have the same workqueue attribute
(e.g. belong to the same NUMA node). This makes pwqs with the same
pool cluster together in the pwq list.

Only do lock/unlock if the pool has changed in flush_workqueue_prep_pwqs().
This reduces the number of expensive lock operations.

The performance data shows this change boosts FIO by 65x in some cases
when multiple concurrent threads write to xfs mount points with fsync.
Comment 1 小龙 admin 2025-04-21 08:52:03 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/5115