Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 365514
b: refs/heads/master
c: 611c92a
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed Mar 13, 2013
1 parent 656128e commit 6ddbe11
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 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: c5aa87bbf4b23f5e4f167489406daeb0ed275c47
refs/heads/master: 611c92a0203091bb022edec7e2d8b765fe148622
16 changes: 8 additions & 8 deletions trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ EXPORT_SYMBOL_GPL(system_freezable_wq);
/**
* for_each_pool - iterate through all worker_pools in the system
* @pool: iteration cursor
* @id: integer used for iteration
* @pi: integer used for iteration
*
* This must be called either with workqueue_lock held or sched RCU read
* locked. If the pool needs to be used beyond the locking in effect, the
Expand All @@ -292,8 +292,8 @@ EXPORT_SYMBOL_GPL(system_freezable_wq);
* The if/else clause exists only for the lockdep assertion and can be
* ignored.
*/
#define for_each_pool(pool, id) \
idr_for_each_entry(&worker_pool_idr, pool, id) \
#define for_each_pool(pool, pi) \
idr_for_each_entry(&worker_pool_idr, pool, pi) \
if (({ assert_rcu_or_wq_lock(); false; })) { } \
else

Expand Down Expand Up @@ -4354,15 +4354,15 @@ void freeze_workqueues_begin(void)
struct worker_pool *pool;
struct workqueue_struct *wq;
struct pool_workqueue *pwq;
int id;
int pi;

spin_lock_irq(&workqueue_lock);

WARN_ON_ONCE(workqueue_freezing);
workqueue_freezing = true;

/* set FREEZING */
for_each_pool(pool, id) {
for_each_pool(pool, pi) {
spin_lock(&pool->lock);
WARN_ON_ONCE(pool->flags & POOL_FREEZING);
pool->flags |= POOL_FREEZING;
Expand Down Expand Up @@ -4435,15 +4435,15 @@ void thaw_workqueues(void)
struct workqueue_struct *wq;
struct pool_workqueue *pwq;
struct worker_pool *pool;
int id;
int pi;

spin_lock_irq(&workqueue_lock);

if (!workqueue_freezing)
goto out_unlock;

/* clear FREEZING */
for_each_pool(pool, id) {
for_each_pool(pool, pi) {
spin_lock(&pool->lock);
WARN_ON_ONCE(!(pool->flags & POOL_FREEZING));
pool->flags &= ~POOL_FREEZING;
Expand All @@ -4457,7 +4457,7 @@ void thaw_workqueues(void)
}

/* kick workers */
for_each_pool(pool, id) {
for_each_pool(pool, pi) {
spin_lock(&pool->lock);
wake_up_worker(pool);
spin_unlock(&pool->lock);
Expand Down

0 comments on commit 6ddbe11

Please sign in to comment.