When workqueue cpumask changes are committed the associated rescuer (if one exists) affinity is not touched and this might be a problem down the line for isolated setups. Make sure rescuers affinity is updated every time a workqueue cpumask changes, so that rescuers can't break isolation. [longman: set_cpus_allowed_ptr() will block until the designated task is enqueued on an allowed CPU, no wake_up_process() needed. Also use the unbound_effective_cpumask() helper as suggested by Tejun.]
Showing the changes to kernel/workqueue.c (1 of 1 file). Show all
Unified · Split
| @@ -5051,6 +5051,11 @@ static void apply_wqattrs_commit(struct apply_wqattrs_ctx *ctx) · 5050 unmodified lines | ||
| 5051 | 5051 | /* update node_nr_active->max */ |
| 5052 | 5052 | wq_update_node_max_active(ctx->wq, -1); |
| 5053 | 5053 | |
| 5054 | + /* rescuer needs to respect wq cpumask changes */ | |
| 5055 | + if (ctx->wq->rescuer) | |
| 5056 | + set_cpus_allowed_ptr(ctx->wq->rescuer->task, | |
| 5057 | + unbound_effective_cpumask(ctx->wq)); | |
| 5058 | + | |
| 5054 | 5059 | mutex_unlock(&ctx->wq->mutex); |
| 5055 | 5060 | } |
| 5056 | 5061 | |