Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 365478
b: refs/heads/master
c: e98d5b1
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed Mar 12, 2013
1 parent 5564d0b commit 61e2701
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 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: 6183c009f6cd94b42e5812adcfd4ba6220a196e1
refs/heads/master: e98d5b16cf4df992c40a7c83f1eae61db5bb03da
44 changes: 22 additions & 22 deletions trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -2715,10 +2715,10 @@ void drain_workqueue(struct workqueue_struct *wq)
* hotter than drain_workqueue() and already looks at @wq->flags.
* Use WQ_DRAINING so that queue doesn't have to check nr_drainers.
*/
spin_lock(&workqueue_lock);
spin_lock_irq(&workqueue_lock);
if (!wq->nr_drainers++)
wq->flags |= WQ_DRAINING;
spin_unlock(&workqueue_lock);
spin_unlock_irq(&workqueue_lock);
reflush:
flush_workqueue(wq);

Expand All @@ -2740,10 +2740,10 @@ void drain_workqueue(struct workqueue_struct *wq)
goto reflush;
}

spin_lock(&workqueue_lock);
spin_lock_irq(&workqueue_lock);
if (!--wq->nr_drainers)
wq->flags &= ~WQ_DRAINING;
spin_unlock(&workqueue_lock);
spin_unlock_irq(&workqueue_lock);
}
EXPORT_SYMBOL_GPL(drain_workqueue);

Expand Down Expand Up @@ -3233,15 +3233,15 @@ struct workqueue_struct *__alloc_workqueue_key(const char *fmt,
* list. Grab it, set max_active accordingly and add the new
* workqueue to workqueues list.
*/
spin_lock(&workqueue_lock);
spin_lock_irq(&workqueue_lock);

if (workqueue_freezing && wq->flags & WQ_FREEZABLE)
for_each_pwq_cpu(cpu, wq)
get_pwq(cpu, wq)->max_active = 0;

list_add(&wq->list, &workqueues);

spin_unlock(&workqueue_lock);
spin_unlock_irq(&workqueue_lock);

return wq;
err:
Expand Down Expand Up @@ -3285,9 +3285,9 @@ void destroy_workqueue(struct workqueue_struct *wq)
* wq list is used to freeze wq, remove from list after
* flushing is complete in case freeze races us.
*/
spin_lock(&workqueue_lock);
spin_lock_irq(&workqueue_lock);
list_del(&wq->list);
spin_unlock(&workqueue_lock);
spin_unlock_irq(&workqueue_lock);

if (wq->flags & WQ_RESCUER) {
kthread_stop(wq->rescuer->task);
Expand Down Expand Up @@ -3336,24 +3336,24 @@ void workqueue_set_max_active(struct workqueue_struct *wq, int max_active)

max_active = wq_clamp_max_active(max_active, wq->flags, wq->name);

spin_lock(&workqueue_lock);
spin_lock_irq(&workqueue_lock);

wq->saved_max_active = max_active;

for_each_pwq_cpu(cpu, wq) {
struct pool_workqueue *pwq = get_pwq(cpu, wq);
struct worker_pool *pool = pwq->pool;

spin_lock_irq(&pool->lock);
spin_lock(&pool->lock);

if (!(wq->flags & WQ_FREEZABLE) ||
!(pool->flags & POOL_FREEZING))
pwq_set_max_active(pwq, max_active);

spin_unlock_irq(&pool->lock);
spin_unlock(&pool->lock);
}

spin_unlock(&workqueue_lock);
spin_unlock_irq(&workqueue_lock);
}
EXPORT_SYMBOL_GPL(workqueue_set_max_active);

Expand Down Expand Up @@ -3599,7 +3599,7 @@ void freeze_workqueues_begin(void)
{
unsigned int cpu;

spin_lock(&workqueue_lock);
spin_lock_irq(&workqueue_lock);

WARN_ON_ONCE(workqueue_freezing);
workqueue_freezing = true;
Expand All @@ -3609,7 +3609,7 @@ void freeze_workqueues_begin(void)
struct workqueue_struct *wq;

for_each_std_worker_pool(pool, cpu) {
spin_lock_irq(&pool->lock);
spin_lock(&pool->lock);

WARN_ON_ONCE(pool->flags & POOL_FREEZING);
pool->flags |= POOL_FREEZING;
Expand All @@ -3622,11 +3622,11 @@ void freeze_workqueues_begin(void)
pwq->max_active = 0;
}

spin_unlock_irq(&pool->lock);
spin_unlock(&pool->lock);
}
}

spin_unlock(&workqueue_lock);
spin_unlock_irq(&workqueue_lock);
}

/**
Expand All @@ -3647,7 +3647,7 @@ bool freeze_workqueues_busy(void)
unsigned int cpu;
bool busy = false;

spin_lock(&workqueue_lock);
spin_lock_irq(&workqueue_lock);

WARN_ON_ONCE(!workqueue_freezing);

Expand All @@ -3671,7 +3671,7 @@ bool freeze_workqueues_busy(void)
}
}
out_unlock:
spin_unlock(&workqueue_lock);
spin_unlock_irq(&workqueue_lock);
return busy;
}

Expand All @@ -3688,7 +3688,7 @@ void thaw_workqueues(void)
{
unsigned int cpu;

spin_lock(&workqueue_lock);
spin_lock_irq(&workqueue_lock);

if (!workqueue_freezing)
goto out_unlock;
Expand All @@ -3698,7 +3698,7 @@ void thaw_workqueues(void)
struct workqueue_struct *wq;

for_each_std_worker_pool(pool, cpu) {
spin_lock_irq(&pool->lock);
spin_lock(&pool->lock);

WARN_ON_ONCE(!(pool->flags & POOL_FREEZING));
pool->flags &= ~POOL_FREEZING;
Expand All @@ -3716,13 +3716,13 @@ void thaw_workqueues(void)

wake_up_worker(pool);

spin_unlock_irq(&pool->lock);
spin_unlock(&pool->lock);
}
}

workqueue_freezing = false;
out_unlock:
spin_unlock(&workqueue_lock);
spin_unlock_irq(&workqueue_lock);
}
#endif /* CONFIG_FREEZER */

Expand Down

0 comments on commit 61e2701

Please sign in to comment.