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
3558 spin_lock_init(&gcwq->lock);3558 spin_lock_init(&gcwq->lock);
3559 INIT_LIST_HEAD(&gcwq->worklist);3559 INIT_LIST_HEAD(&gcwq->worklist);
3560 gcwq->cpu = cpu;3560 gcwq->cpu = cpu;
3561 if (cpu == WORK_CPU_UNBOUND)3561 gcwq->flags |= GCWQ_DISASSOCIATED;
3562 gcwq->flags |= GCWQ_DISASSOCIATED;
3563 3562
3564 INIT_LIST_HEAD(&gcwq->idle_list);3563 INIT_LIST_HEAD(&gcwq->idle_list);
3565 for (i = 0; i < BUSY_WORKER_HASH_SIZE; i++)3564 for (i = 0; i < BUSY_WORKER_HASH_SIZE; i++)
@@ -3583,6 +3582,8 @@ static int __init init_workqueues(void) · 17 unmodified lines
3583 struct global_cwq *gcwq = get_gcwq(cpu);3582 struct global_cwq *gcwq = get_gcwq(cpu);
3584 struct worker *worker;3583 struct worker *worker;
3585 3584
3585 if (cpu != WORK_CPU_UNBOUND)
3586 gcwq->flags &= ~GCWQ_DISASSOCIATED;
3586 worker = create_worker(gcwq, true);3587 worker = create_worker(gcwq, true);
3587 BUG_ON(!worker);3588 BUG_ON(!worker);
3588 spin_lock_irq(&gcwq->lock);3589 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