diff options
| author | Lai Jiangshan <jiangshan.ljs@antgroup.com> | 2025-12-08 21:25:18 +0800 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2025-12-08 09:17:49 -1000 |
| commit | e5a30c303b07a4d6083e0f7f051b53add6d93c5d (patch) | |
| tree | 5763b34b371e5ad86041208682b07ea9bd452d73 /tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git | |
| parent | fc5ff53d2aa088713870cd684b160ee95c018520 (diff) | |
workqueue: Process rescuer work items one-by-one using a cursor
Previously, the rescuer scanned for all matching work items at once and
processed them within a single rescuer thread, which could cause one
blocking work item to stall all others.
Make the rescuer process work items one-by-one instead of slurping all
matches in a single pass.
Break the rescuer loop after finding and processing the first matching
work item, then restart the search to pick up the next. This gives
normal worker threads a chance to process other items which gives them
the opportunity to be processed instead of waiting on the rescuer's
queue and prevents a blocking work item from stalling the rest once
memory pressure is relieved.
Introduce a dummy cursor work item to avoid potentially O(N^2)
rescans of the work list. The marker records the resume position for
the next scan, eliminating redundant traversals.
Also introduce RESCUER_BATCH to control the maximum number of work items
the rescuer processes in each turn, and move on to other PWQs when the
limit is reached.
Cc: ying chen <yc1082463@gmail.com>
Reported-by: ying chen <yc1082463@gmail.com>
Fixes: e22bee782b3b ("workqueue: implement concurrency managed dynamic worker pool")
Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
