History

workqueue: fix GCWQ_DISASSOCIATED initialization

init_workqueues() incorrectly marks workqueues for all possible CPUs associated. Combined with mayday_mask initialization bug, this can make rescuers keep trying to bind to an offline gcwq indefinitely. Fix init_workqueues() such that only online CPUs have their gcwqs have GCWQ_DISASSOCIATED cleared.

Tejun Heo committed 16 years ago

Commit 477a3c31 parent 7c388751 file · +3 −2Browse files

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

Unified · Split

kernel/workqueue.c+3−2
@@ -3558,8 +3558,7 @@ static int __init init_workqueues(void) · 3557 unmodified lines
35583558 spin_lock_init(&gcwq->lock);
35593559 INIT_LIST_HEAD(&gcwq->worklist);
35603560 gcwq->cpu = cpu;
3561− if (cpu == WORK_CPU_UNBOUND)
3562− gcwq->flags |= GCWQ_DISASSOCIATED;
3561+ gcwq->flags |= GCWQ_DISASSOCIATED;
35633562
35643563 INIT_LIST_HEAD(&gcwq->idle_list);
35653564 for (i = 0; i < BUSY_WORKER_HASH_SIZE; i++)
@@ -3583,6 +3582,8 @@ static int __init init_workqueues(void) · 17 unmodified lines
35833582 struct global_cwq *gcwq = get_gcwq(cpu);
35843583 struct worker *worker;
35853584
3585+ if (cpu != WORK_CPU_UNBOUND)
3586+ gcwq->flags &= ~GCWQ_DISASSOCIATED;
35863587 worker = create_worker(gcwq, true);
35873588 BUG_ON(!worker);
35883589 spin_lock_irq(&gcwq->lock);

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