mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 17:41:50 +00:00
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>
This commit is contained in:
parent
77668c8b55
commit
534a3fbb3f
1 changed files with 2 additions and 6 deletions
|
@ -4103,17 +4103,13 @@ static void wq_update_unbound_numa(struct workqueue_struct *wq, int cpu,
|
||||||
* Let's determine what needs to be done. If the target cpumask is
|
* Let's determine what needs to be done. If the target cpumask is
|
||||||
* different from wq's, we need to compare it to @pwq's and create
|
* different from wq's, we need to compare it to @pwq's and create
|
||||||
* a new one if they don't match. If the target cpumask equals
|
* a new one if they don't match. If the target cpumask equals
|
||||||
* wq's, the default pwq should be used. If @pwq is already the
|
* wq's, the default pwq should be used.
|
||||||
* default one, nothing to do; otherwise, install the default one.
|
|
||||||
*/
|
*/
|
||||||
if (wq_calc_node_cpumask(wq->unbound_attrs, node, cpu_off, cpumask)) {
|
if (wq_calc_node_cpumask(wq->unbound_attrs, node, cpu_off, cpumask)) {
|
||||||
if (cpumask_equal(cpumask, pwq->pool->attrs->cpumask))
|
if (cpumask_equal(cpumask, pwq->pool->attrs->cpumask))
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
} else {
|
} else {
|
||||||
if (pwq == wq->dfl_pwq)
|
goto use_dfl_pwq;
|
||||||
goto out_unlock;
|
|
||||||
else
|
|
||||||
goto use_dfl_pwq;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_unlock(&wq->mutex);
|
mutex_unlock(&wq->mutex);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue