aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-03-13 19:51:35 -0400
committerTejun Heo <tj@kernel.org>2013-03-13 19:51:35 -0400
commit0fbd95aa8a056194933fba4ae78c50fc20f0704e (patch)
treef9f092a3f5268dbb30c1b233f51917b81c452008 /kernel/workqueue.c
parente62676169118bc2d42e5008b3f8872646313f077 (diff)
workqueue: relocate pwq_set_max_active()
pwq_set_max_active() is gonna be modified and used during pool_workqueue init. Move it above init_and_link_pwq(). This patch is pure code reorganization and doesn't introduce any functional changes. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index f5c8bbb9ada3..d51928981615 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3725,6 +3725,26 @@ static void pwq_unbound_release_workfn(struct work_struct *work)
3725 kfree(wq); 3725 kfree(wq);
3726} 3726}
3727 3727
3728/**
3729 * pwq_set_max_active - adjust max_active of a pwq
3730 * @pwq: target pool_workqueue
3731 * @max_active: new max_active value.
3732 *
3733 * Set @pwq->max_active to @max_active and activate delayed works if
3734 * increased.
3735 *
3736 * CONTEXT:
3737 * spin_lock_irq(pool->lock).
3738 */
3739static void pwq_set_max_active(struct pool_workqueue *pwq, int max_active)
3740{
3741 pwq->max_active = max_active;
3742
3743 while (!list_empty(&pwq->delayed_works) &&
3744 pwq->nr_active < pwq->max_active)
3745 pwq_activate_first_delayed(pwq);
3746}
3747
3728static void init_and_link_pwq(struct pool_workqueue *pwq, 3748static void init_and_link_pwq(struct pool_workqueue *pwq,
3729 struct workqueue_struct *wq, 3749 struct workqueue_struct *wq,
3730 struct worker_pool *pool, 3750 struct worker_pool *pool,
@@ -4012,26 +4032,6 @@ void destroy_workqueue(struct workqueue_struct *wq)
4012EXPORT_SYMBOL_GPL(destroy_workqueue); 4032EXPORT_SYMBOL_GPL(destroy_workqueue);
4013 4033
4014/** 4034/**
4015 * pwq_set_max_active - adjust max_active of a pwq
4016 * @pwq: target pool_workqueue
4017 * @max_active: new max_active value.
4018 *
4019 * Set @pwq->max_active to @max_active and activate delayed works if
4020 * increased.
4021 *
4022 * CONTEXT:
4023 * spin_lock_irq(pool->lock).
4024 */
4025static void pwq_set_max_active(struct pool_workqueue *pwq, int max_active)
4026{
4027 pwq->max_active = max_active;
4028
4029 while (!list_empty(&pwq->delayed_works) &&
4030 pwq->nr_active < pwq->max_active)
4031 pwq_activate_first_delayed(pwq);
4032}
4033
4034/**
4035 * workqueue_set_max_active - adjust max_active of a workqueue 4035 * workqueue_set_max_active - adjust max_active of a workqueue
4036 * @wq: target workqueue 4036 * @wq: target workqueue
4037 * @max_active: new max_active value. 4037 * @max_active: new max_active value.