diff options
| author | Daeseok Youn <daeseok.youn@gmail.com> | 2014-04-17 20:08:14 -0400 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2014-04-18 15:50:34 -0400 |
| commit | 534a3fbb3f37c42ec32de9876681c3195be0b658 (patch) | |
| tree | c5093904686c09963241bb071f65a2ff7ce50926 /kernel/workqueue.c | |
| parent | 77668c8b559e4fe2acf2a0749c7c83cde49a5025 (diff) | |
workqueue: simplify wq_update_unbound_numa() by jumping to use_dfl_pwq if the target cpumask equals wq's
wq_update_unbound_numa(), when it's decided that the newly updated
cpumask equals the default, looks at whether the current pwq is
already the default one and skips setting pwq to the default one.
This extra step is unnecessary and we can always jump to use_dfl_pwq
instead. Simplify the code by removing the conditional.
This doesn't make any functional difference.
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
| -rw-r--r-- | kernel/workqueue.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 8edc87185427..c3f076f0f8fd 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
| @@ -4103,17 +4103,13 @@ static void wq_update_unbound_numa(struct workqueue_struct *wq, int cpu, | |||
| 4103 | * Let's determine what needs to be done. If the target cpumask is | 4103 | * Let's determine what needs to be done. If the target cpumask is |
| 4104 | * different from wq's, we need to compare it to @pwq's and create | 4104 | * different from wq's, we need to compare it to @pwq's and create |
| 4105 | * a new one if they don't match. If the target cpumask equals | 4105 | * a new one if they don't match. If the target cpumask equals |
| 4106 | * wq's, the default pwq should be used. If @pwq is already the | 4106 | * wq's, the default pwq should be used. |
| 4107 | * default one, nothing to do; otherwise, install the default one. | ||
| 4108 | */ | 4107 | */ |
| 4109 | if (wq_calc_node_cpumask(wq->unbound_attrs, node, cpu_off, cpumask)) { | 4108 | if (wq_calc_node_cpumask(wq->unbound_attrs, node, cpu_off, cpumask)) { |
| 4110 | if (cpumask_equal(cpumask, pwq->pool->attrs->cpumask)) | 4109 | if (cpumask_equal(cpumask, pwq->pool->attrs->cpumask)) |
| 4111 | goto out_unlock; | 4110 | goto out_unlock; |
| 4112 | } else { | 4111 | } else { |
| 4113 | if (pwq == wq->dfl_pwq) | 4112 | goto use_dfl_pwq; |
| 4114 | goto out_unlock; | ||
| 4115 | else | ||
| 4116 | goto use_dfl_pwq; | ||
| 4117 | } | 4113 | } |
| 4118 | 4114 | ||
| 4119 | mutex_unlock(&wq->mutex); | 4115 | mutex_unlock(&wq->mutex); |
