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.
Showing the changes to kernel/workqueue.c (1 of 1 file). Show all
Unified · Split
| @@ -5125,10 +5125,8 @@ static void apply_wqattrs_unlock(void) · 5124 unmodified lines | ||
| 5125 | 5125 | * wq_calc_pod_cpumask - calculate a wq_attrs' cpumask for a pod |
| 5126 | 5126 | * @attrs: the wq_attrs of the default pwq of the target workqueue |
| 5127 | 5127 | * @cpu: the target CPU |
| 5128 | − * @cpu_going_down: if >= 0, the CPU to consider as offline | |
| 5129 | 5128 | * |
| 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. | |
| 5132 | 5130 | * The result is stored in @attrs->__pod_cpumask. |
| 5133 | 5131 | * |
| 5134 | 5132 | * 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 | ||
| 5137 | 5135 | * |
| 5138 | 5136 | * The caller is responsible for ensuring that the cpumask of @pod stays stable. |
| 5139 | 5137 | */ |
| 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) | |
| 5142 | 5139 | { |
| 5143 | 5140 | const struct wq_pod_type *pt = wqattrs_pod_type(attrs); |
| 5144 | 5141 | int pod = pt->cpu_pod[cpu]; |
| @@ -5234,7 +5231,7 @@ apply_wqattrs_prepare(struct workqueue_struct *wq, · 89 unmodified lines | ||
| 5234 | 5231 | ctx->dfl_pwq->refcnt++; |
| 5235 | 5232 | ctx->pwq_tbl[cpu] = ctx->dfl_pwq; |
| 5236 | 5233 | } else { |
| 5237 | − wq_calc_pod_cpumask(new_attrs, cpu, -1); | |
| 5234 | + wq_calc_pod_cpumask(new_attrs, cpu); | |
| 5238 | 5235 | ctx->pwq_tbl[cpu] = alloc_unbound_pwq(wq, new_attrs); |
| 5239 | 5236 | if (!ctx->pwq_tbl[cpu]) |
| 5240 | 5237 | goto out_free; |
| @@ -5368,7 +5365,6 @@ int apply_workqueue_attrs(struct workqueue_struct *wq, · 127 unmodified lines | ||
| 5368 | 5365 | static void wq_update_pod(struct workqueue_struct *wq, int cpu, |
| 5369 | 5366 | int hotplug_cpu, bool online) |
| 5370 | 5367 | { |
| 5371 | − int off_cpu = online ? -1 : hotplug_cpu; | |
| 5372 | 5368 | struct pool_workqueue *old_pwq = NULL, *pwq; |
| 5373 | 5369 | struct workqueue_attrs *target_attrs; |
| 5374 | 5370 | |
| @@ -5388,7 +5384,7 @@ static void wq_update_pod(struct workqueue_struct *wq, int cpu, · 13 unmodified lines | ||
| 5388 | 5384 | wqattrs_actualize_cpumask(target_attrs, wq_unbound_cpumask); |
| 5389 | 5385 | |
| 5390 | 5386 | /* 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); | |
| 5392 | 5388 | if (wqattrs_equal(target_attrs, unbound_pwq(wq, cpu)->pool->attrs)) |
| 5393 | 5389 | return; |
| 5394 | 5390 | |