Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327187
b: refs/heads/master
c: eab6d82
h: refs/heads/master
i:
  327185: c2a6468
  327183: 7a2f3e9
v: v3
  • Loading branch information
Lai Jiangshan authored and Tejun Heo committed Sep 18, 2012
1 parent 5623fab commit 4a6739d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ea1abd6197d5805655da1bb589929762f4b4aa08
refs/heads/master: eab6d82843ee1df244f8847d1bf8bb89160ec4aa
18 changes: 2 additions & 16 deletions trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -1649,16 +1649,8 @@ static void busy_worker_rebind_fn(struct work_struct *work)
struct worker *worker = container_of(work, struct worker, rebind_work);
struct global_cwq *gcwq = worker->pool->gcwq;

worker_maybe_bind_and_lock(worker);

/*
* %WORKER_REBIND must be cleared even if the above binding failed;
* otherwise, we may confuse the next CPU_UP cycle or oops / get
* stuck by calling idle_worker_rebind() prematurely. If CPU went
* down again inbetween, %WORKER_UNBOUND would be set, so clearing
* %WORKER_REBIND is always safe.
*/
worker_clr_flags(worker, WORKER_REBIND);
if (worker_maybe_bind_and_lock(worker))
worker_clr_flags(worker, WORKER_UNBOUND);

spin_unlock_irq(&gcwq->lock);
}
Expand Down Expand Up @@ -1721,15 +1713,9 @@ static void rebind_workers(struct global_cwq *gcwq)

/* rebind busy workers */
for_each_busy_worker(worker, i, pos, gcwq) {
unsigned long worker_flags = worker->flags;
struct work_struct *rebind_work = &worker->rebind_work;
struct workqueue_struct *wq;

/* morph UNBOUND to REBIND atomically */
worker_flags &= ~WORKER_UNBOUND;
worker_flags |= WORKER_REBIND;
ACCESS_ONCE(worker->flags) = worker_flags;

if (test_and_set_bit(WORK_STRUCT_PENDING_BIT,
work_data_bits(rebind_work)))
continue;
Expand Down

0 comments on commit 4a6739d

Please sign in to comment.