Commit 88a41b18 authored by Lai Jiangshan's avatar Lai Jiangshan Committed by Tejun Heo

workqueue: Remove the argument @cpu_going_down from wq_calc_pod_cpumask()

wq_calc_pod_cpumask() uses wq_online_cpumask, which excludes the cpu
going down, so the argument cpu_going_down is unused and can be removed.
Signed-off-by: default avatarLai Jiangshan <jiangshan.ljs@antgroup.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 2cb61f76
...@@ -5125,10 +5125,8 @@ static void apply_wqattrs_unlock(void) ...@@ -5125,10 +5125,8 @@ static void apply_wqattrs_unlock(void)
* wq_calc_pod_cpumask - calculate a wq_attrs' cpumask for a pod * wq_calc_pod_cpumask - calculate a wq_attrs' cpumask for a pod
* @attrs: the wq_attrs of the default pwq of the target workqueue * @attrs: the wq_attrs of the default pwq of the target workqueue
* @cpu: the target CPU * @cpu: the target CPU
* @cpu_going_down: if >= 0, the CPU to consider as offline
* *
* Calculate the cpumask a workqueue with @attrs should use on @pod. If * Calculate the cpumask a workqueue with @attrs should use on @pod.
* @cpu_going_down is >= 0, that cpu is considered offline during calculation.
* The result is stored in @attrs->__pod_cpumask. * The result is stored in @attrs->__pod_cpumask.
* *
* If pod affinity is not enabled, @attrs->cpumask is always used. If enabled * If pod affinity is not enabled, @attrs->cpumask is always used. If enabled
...@@ -5137,8 +5135,7 @@ static void apply_wqattrs_unlock(void) ...@@ -5137,8 +5135,7 @@ static void apply_wqattrs_unlock(void)
* *
* The caller is responsible for ensuring that the cpumask of @pod stays stable. * The caller is responsible for ensuring that the cpumask of @pod stays stable.
*/ */
static void wq_calc_pod_cpumask(struct workqueue_attrs *attrs, int cpu, static void wq_calc_pod_cpumask(struct workqueue_attrs *attrs, int cpu)
int cpu_going_down)
{ {
const struct wq_pod_type *pt = wqattrs_pod_type(attrs); const struct wq_pod_type *pt = wqattrs_pod_type(attrs);
int pod = pt->cpu_pod[cpu]; int pod = pt->cpu_pod[cpu];
...@@ -5234,7 +5231,7 @@ apply_wqattrs_prepare(struct workqueue_struct *wq, ...@@ -5234,7 +5231,7 @@ apply_wqattrs_prepare(struct workqueue_struct *wq,
ctx->dfl_pwq->refcnt++; ctx->dfl_pwq->refcnt++;
ctx->pwq_tbl[cpu] = ctx->dfl_pwq; ctx->pwq_tbl[cpu] = ctx->dfl_pwq;
} else { } else {
wq_calc_pod_cpumask(new_attrs, cpu, -1); wq_calc_pod_cpumask(new_attrs, cpu);
ctx->pwq_tbl[cpu] = alloc_unbound_pwq(wq, new_attrs); ctx->pwq_tbl[cpu] = alloc_unbound_pwq(wq, new_attrs);
if (!ctx->pwq_tbl[cpu]) if (!ctx->pwq_tbl[cpu])
goto out_free; goto out_free;
...@@ -5368,7 +5365,6 @@ int apply_workqueue_attrs(struct workqueue_struct *wq, ...@@ -5368,7 +5365,6 @@ int apply_workqueue_attrs(struct workqueue_struct *wq,
static void wq_update_pod(struct workqueue_struct *wq, int cpu, static void wq_update_pod(struct workqueue_struct *wq, int cpu,
int hotplug_cpu, bool online) int hotplug_cpu, bool online)
{ {
int off_cpu = online ? -1 : hotplug_cpu;
struct pool_workqueue *old_pwq = NULL, *pwq; struct pool_workqueue *old_pwq = NULL, *pwq;
struct workqueue_attrs *target_attrs; struct workqueue_attrs *target_attrs;
...@@ -5388,7 +5384,7 @@ static void wq_update_pod(struct workqueue_struct *wq, int cpu, ...@@ -5388,7 +5384,7 @@ static void wq_update_pod(struct workqueue_struct *wq, int cpu,
wqattrs_actualize_cpumask(target_attrs, wq_unbound_cpumask); wqattrs_actualize_cpumask(target_attrs, wq_unbound_cpumask);
/* nothing to do if the target cpumask matches the current pwq */ /* nothing to do if the target cpumask matches the current pwq */
wq_calc_pod_cpumask(target_attrs, cpu, off_cpu); wq_calc_pod_cpumask(target_attrs, cpu);
if (wqattrs_equal(target_attrs, unbound_pwq(wq, cpu)->pool->attrs)) if (wqattrs_equal(target_attrs, unbound_pwq(wq, cpu)->pool->attrs))
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment