History

workqueue: void unneeded requeuing the pwq in rescuer thread

008847f66c3 ("workqueue: allow rescuer thread to do more work.") made the rescuer worker requeue the pwq immediately if there may be more work items which need rescuing instead of waiting for the next mayday timer expiration. Unfortunately, it checks only whether the pool needs help from rescuers, but it doesn't check whether the pwq has work items in the pool (the real reason that this rescuer can help for the pool). The patch adds the check and void unneeded requeuing.

Lai Jiangshan committed 6 years ago

Commit 4f3f4cf1 parent a9b8a981 file · +1 −1Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/workqueue.c+1−1
@@ -2530,7 +2530,7 @@ repeat: · 2529 unmodified lines
25302530 * being used to relieve memory pressure, don't
25312531 * incur MAYDAY_INTERVAL delay inbetween.
25322532 */
2533− if (need_to_create_worker(pool)) {
2533+ if (pwq->nr_active && need_to_create_worker(pool)) {
25342534 raw_spin_lock(&wq_mayday_lock);
25352535 /*
25362536 * Queue iff we aren't racing destruction

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t