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 | * wq_calc_pod_cpumask - calculate a wq_attrs' cpumask for a pod | 5125 | * wq_calc_pod_cpumask - calculate a wq_attrs' cpumask for a pod |
| 5126 | * @attrs: the wq_attrs of the default pwq of the target workqueue | 5126 | * @attrs: the wq_attrs of the default pwq of the target workqueue |
| 5127 | * @cpu: the target CPU | 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 | 5129 | * Calculate the cpumask a workqueue with @attrs should use on @pod. |
| 5131 | * @cpu_going_down is >= 0, that cpu is considered offline during calculation. | ||
| 5132 | * The result is stored in @attrs->__pod_cpumask. | 5130 | * The result is stored in @attrs->__pod_cpumask. |
| 5133 | * | 5131 | * |
| 5134 | * If pod affinity is not enabled, @attrs->cpumask is always used. If enabled | 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 | * The caller is responsible for ensuring that the cpumask of @pod stays stable. | 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, | 5138 | static void wq_calc_pod_cpumask(struct workqueue_attrs *attrs, int cpu) |
| 5141 | int cpu_going_down) | ||
| 5142 | { | 5139 | { |
| 5143 | const struct wq_pod_type *pt = wqattrs_pod_type(attrs); | 5140 | const struct wq_pod_type *pt = wqattrs_pod_type(attrs); |
| 5144 | int pod = pt->cpu_pod[cpu]; | 5141 | int pod = pt->cpu_pod[cpu]; |
| @@ -5234,7 +5231,7 @@ apply_wqattrs_prepare(struct workqueue_struct *wq, · 89 unmodified lines | |||
| 5234 | ctx->dfl_pwq->refcnt++; | 5231 | ctx->dfl_pwq->refcnt++; |
| 5235 | ctx->pwq_tbl[cpu] = ctx->dfl_pwq; | 5232 | ctx->pwq_tbl[cpu] = ctx->dfl_pwq; |
| 5236 | } else { | 5233 | } else { |
| 5237 | wq_calc_pod_cpumask(new_attrs, cpu, -1); | 5234 | wq_calc_pod_cpumask(new_attrs, cpu); |
| 5238 | ctx->pwq_tbl[cpu] = alloc_unbound_pwq(wq, new_attrs); | 5235 | ctx->pwq_tbl[cpu] = alloc_unbound_pwq(wq, new_attrs); |
| 5239 | if (!ctx->pwq_tbl[cpu]) | 5236 | if (!ctx->pwq_tbl[cpu]) |
| 5240 | goto out_free; | 5237 | goto out_free; |
| @@ -5368,7 +5365,6 @@ int apply_workqueue_attrs(struct workqueue_struct *wq, · 127 unmodified lines | |||
| 5368 | static void wq_update_pod(struct workqueue_struct *wq, int cpu, | 5365 | static void wq_update_pod(struct workqueue_struct *wq, int cpu, |
| 5369 | int hotplug_cpu, bool online) | 5366 | int hotplug_cpu, bool online) |
| 5370 | { | 5367 | { |
| 5371 | int off_cpu = online ? -1 : hotplug_cpu; | ||
| 5372 | struct pool_workqueue *old_pwq = NULL, *pwq; | 5368 | struct pool_workqueue *old_pwq = NULL, *pwq; |
| 5373 | struct workqueue_attrs *target_attrs; | 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 | wqattrs_actualize_cpumask(target_attrs, wq_unbound_cpumask); | 5384 | wqattrs_actualize_cpumask(target_attrs, wq_unbound_cpumask); |
| 5389 | 5385 | ||
| 5390 | /* nothing to do if the target cpumask matches the current pwq */ | 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 | if (wqattrs_equal(target_attrs, unbound_pwq(wq, cpu)->pool->attrs)) | 5388 | if (wqattrs_equal(target_attrs, unbound_pwq(wq, cpu)->pool->attrs)) |
| 5393 | return; | 5389 | return; |
| 5394 | 5390 | ||