History

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.

Lai Jiangshan committed 2 years ago

Commit 88a41b11 parent 2cb61f71 file · +4 −8Browse files

Showing the changes to kernel/workqueue.c (1 of 1 file). Show all

Unified · Split

kernel/workqueue.c+4−8
@@ -5125,10 +5125,8 @@ static void apply_wqattrs_unlock(void) · 5124 unmodified lines
51255125 * wq_calc_pod_cpumask - calculate a wq_attrs' cpumask for a pod
51265126 * @attrs: the wq_attrs of the default pwq of the target workqueue
51275127 * @cpu: the target CPU
5128− * @cpu_going_down: if >= 0, the CPU to consider as offline
51295128 *
5130− * Calculate the cpumask a workqueue with @attrs should use on @pod. If
5131− * @cpu_going_down is >= 0, that cpu is considered offline during calculation.
5129+ * Calculate the cpumask a workqueue with @attrs should use on @pod.
51325130 * The result is stored in @attrs->__pod_cpumask.
51335131 *
51345132 * If pod affinity is not enabled, @attrs->cpumask is always used. If enabled
@@ -5137,8 +5135,7 @@ static void apply_wqattrs_unlock(void) · 2 unmodified lines
51375135 *
51385136 * The caller is responsible for ensuring that the cpumask of @pod stays stable.
51395137 */
5140−static void wq_calc_pod_cpumask(struct workqueue_attrs *attrs, int cpu,
5141− int cpu_going_down)
5138+static void wq_calc_pod_cpumask(struct workqueue_attrs *attrs, int cpu)
51425139 {
51435140 const struct wq_pod_type *pt = wqattrs_pod_type(attrs);
51445141 int pod = pt->cpu_pod[cpu];
@@ -5234,7 +5231,7 @@ apply_wqattrs_prepare(struct workqueue_struct *wq, · 89 unmodified lines
52345231 ctx->dfl_pwq->refcnt++;
52355232 ctx->pwq_tbl[cpu] = ctx->dfl_pwq;
52365233 } else {
5237− wq_calc_pod_cpumask(new_attrs, cpu, -1);
5234+ wq_calc_pod_cpumask(new_attrs, cpu);
52385235 ctx->pwq_tbl[cpu] = alloc_unbound_pwq(wq, new_attrs);
52395236 if (!ctx->pwq_tbl[cpu])
52405237 goto out_free;
@@ -5368,7 +5365,6 @@ int apply_workqueue_attrs(struct workqueue_struct *wq, · 127 unmodified lines
53685365 static void wq_update_pod(struct workqueue_struct *wq, int cpu,
53695366 int hotplug_cpu, bool online)
53705367 {
5371− int off_cpu = online ? -1 : hotplug_cpu;
53725368 struct pool_workqueue *old_pwq = NULL, *pwq;
53735369 struct workqueue_attrs *target_attrs;
53745370
@@ -5388,7 +5384,7 @@ static void wq_update_pod(struct workqueue_struct *wq, int cpu, · 13 unmodified lines
53885384 wqattrs_actualize_cpumask(target_attrs, wq_unbound_cpumask);
53895385
53905386 /* nothing to do if the target cpumask matches the current pwq */
5391− wq_calc_pod_cpumask(target_attrs, cpu, off_cpu);
5387+ wq_calc_pod_cpumask(target_attrs, cpu);
53925388 if (wqattrs_equal(target_attrs, unbound_pwq(wq, cpu)->pool->attrs))
53935389 return;
53945390