diff options
| author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2012-09-19 13:40:48 -0400 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2012-09-19 13:40:48 -0400 |
| commit | 70369b117a8fc5ac18a635ced23ee49f8e722e7b (patch) | |
| tree | deec5ade1639ccebe8db218e5b8a5632d86317ac /kernel/workqueue.c | |
| parent | 9f4bd4cddbb50d7617353102e10ce511c5ef6df2 (diff) | |
workqueue: use cwq_set_max_active() helper for workqueue_set_max_active()
workqueue_set_max_active() may increase ->max_active without
activating delayed works and may make the activation order differ from
the queueing order. Both aren't strictly bugs but the resulting
behavior could be a bit odd.
To make things more consistent, use cwq_set_max_active() helper which
immediately makes use of the newly increased max_mactive if there are
delayed work items and also keeps the activation order.
tj: Slight update to description.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
| -rw-r--r-- | kernel/workqueue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index b5d722548ff..4f5c61f8b0e 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
| @@ -3413,7 +3413,7 @@ void workqueue_set_max_active(struct workqueue_struct *wq, int max_active) | |||
| 3413 | 3413 | ||
| 3414 | if (!(wq->flags & WQ_FREEZABLE) || | 3414 | if (!(wq->flags & WQ_FREEZABLE) || |
| 3415 | !(gcwq->flags & GCWQ_FREEZING)) | 3415 | !(gcwq->flags & GCWQ_FREEZING)) |
| 3416 | get_cwq(gcwq->cpu, wq)->max_active = max_active; | 3416 | cwq_set_max_active(get_cwq(gcwq->cpu, wq), max_active); |
| 3417 | 3417 | ||
| 3418 | spin_unlock_irq(&gcwq->lock); | 3418 | spin_unlock_irq(&gcwq->lock); |
| 3419 | } | 3419 | } |
